From: nasm-bot f. H. P. A. <hp...@li...> - 2016-02-12 03:27:16
|
Commit-ID: 97577e82d7230e5b3ef0947c8d62b9a3326fe4a1 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=97577e82d7230e5b3ef0947c8d62b9a3326fe4a1 Author: H. Peter Anvin <hp...@li...> AuthorDate: Thu, 11 Feb 2016 19:25:33 -0800 Committer: H. Peter Anvin <hp...@li...> CommitDate: Thu, 11 Feb 2016 19:25:33 -0800 macho64: remove LC_DATA_IN_CODE, change reloc type to 1 Change the relocation type to SIGNED instead of BRANCH, this is probably more correct. Signed-off-by: H. Peter Anvin <hp...@li...> --- output/outmac64.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/output/outmac64.c b/output/outmac64.c index 16e3774..76fa7ad 100644 --- a/output/outmac64.c +++ b/output/outmac64.c @@ -441,7 +441,7 @@ static int32_t add_reloc(struct section *sect, int32_t section, /* inter-section */ } else { - r->type = 2; // X86_64_RELOC_BRANCH + r->type = 1; // X86_64_RELOC_SIGNED fi = get_section_fileindex_by_index(section); /* external */ @@ -1015,9 +1015,6 @@ static void macho_calculate_sizes (void) head_sizeofcmds64 += MACHO_SYMCMD_SIZE; } - ++head_ncmds64; /* LC_DATA_IN_CODE */ - head_sizeofcmds64 += MACHO_DATA_IN_CODE_CMD_SIZE; - /* Create a table of sections by file index to avoid linear search */ sectstab = nasm_malloc(seg_nsects64 + 1); sectstab[0] = NULL; @@ -1404,12 +1401,6 @@ static void macho_write (void) fwriteint32_t(strslen, ofile); /* string table size */ } - /* emit dummy data in code command */ - fwriteint32_t(LC_DATA_IN_CODE, ofile); - fwriteint32_t(MACHO_DATA_IN_CODE_CMD_SIZE, ofile); - fwriteint32_t(offset, ofile); - fwriteint32_t(0, ofile); /* no actual DATA_IN_CODE */ - /* emit section data */ if (seg_nsects64 > 0) macho_write_section (); |