diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2016-02-11 19:25:33 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2016-02-11 19:25:33 -0800 |
commit | 97577e82d7230e5b3ef0947c8d62b9a3326fe4a1 (patch) | |
tree | 77e1f26ea74698e4c2742a188c511a305c144730 | |
parent | 5eebc6bc2bdb5e4607075f39edfe62d8b9d699f6 (diff) | |
download | nasm-97577e82d7230e5b3ef0947c8d62b9a3326fe4a1.tar.gz |
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 <hpa@linux.intel.com>
-rw-r--r-- | output/outmac64.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/output/outmac64.c b/output/outmac64.c index 16e37747..76fa7ad3 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 (); |