nasm/output
Delan Azabani 5b730a197a out: maco64 -- Fix erroneously small write for OUT_REL4ADR
Ensure that the int64_t offset value, which ultimately comes from an
int64_t value in gencode() (assemble.c:1906), is completely written to
the temporary buffer, instead of merely its least significant 32 bits.

Prior to this change, WRITELONG was used instead of WRITEDLONG, which
resulted in add_reloc being passed an int64_t "reloff" whose least
significant 32 bits were those from the aforementioned offset value,
and whose most significant 32 bits were stack garbage from "mydata".

This led to get_closest_section_symbol_by_offset() attempting to search
for extremely large values of "offset" among the symbols in "syms",
which meant that the last symbol with a matching section number would
always win the symbol search.

In effect, this clobbered the resultant relocation information, such
that all entries would be resolved with the same symbol.

Test output can be found here

https://www.azabani.com/patch/2/output.txt

This patch fixes

http://bugzilla.nasm.us/show_bug.cgi?id=3392306

Signed-off-by: Delan Azabani <delan@azabani.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2015-06-02 13:22:32 +03:00
..
dwarf.h output/dwarf.h: update dwarf constants 2009-08-10 16:00:43 -07:00
elf.h Elf: Use SHA_ANY constant instead of open coded number 2010-04-11 12:58:05 +04:00
nulldbg.c Add missing header file in output/nulldbg.c 2014-11-25 12:14:52 -08:00
nullout.c Rename SEGALIGN to SECTALIGN 2010-04-21 18:09:54 +04:00
outaout.c output: dbg,aout,elf32 -- Fix out for signed relocations 2015-02-21 21:14:28 +03:00
outaout.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outas86.c Replace unchecked fwrite() calls 2014-10-21 12:50:47 -07:00
outas86.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outbin.c output: bin -- Fix section length miscalc for OUT_ADDRESS 2015-02-15 18:18:57 +03:00
outbin.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outcoff.c Add missing static declaration in output/outcoff.c 2014-11-25 12:14:52 -08:00
outcoff.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outdbg.c output: dbg,aout,elf32 -- Fix out for signed relocations 2015-02-21 21:14:28 +03:00
outelf32.c output: dbg,aout,elf32 -- Fix out for signed relocations 2015-02-21 21:14:28 +03:00
outelf64.c output: elf64 -- increase .symtab and .rel* alignment to 8 2015-04-16 01:02:55 +03:00
outelf.c output: elf -- Move elf_directive into single instance 2014-08-29 20:30:57 +04:00
outelf.h output: elf -- Move common structures into outelf.h header 2014-09-21 13:03:26 +04:00
outelf.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outelfx32.c Replace unchecked fwrite() calls 2014-10-21 12:50:47 -07:00
outform.c ofmt: Alias shortname must be used for __OUTPUT_FORMAT__ macro 2011-04-06 18:32:15 +04:00
outform.h backend: add support for x32 ELF 2012-02-03 12:08:59 -08:00
outieee.c Add missing static declaration in output/outieee.c 2014-11-25 12:14:52 -08:00
outlib.c Add support for one-byte relocations 2010-05-06 15:33:24 -07:00
outlib.h Rename SEGALIGN to SECTALIGN 2010-04-21 18:09:54 +04:00
outmac32.c Replace unchecked fwrite() calls 2014-10-21 12:50:47 -07:00
outmac64.c out: maco64 -- Fix erroneously small write for OUT_REL4ADR 2015-06-02 13:22:32 +03:00
outmacho.mac macho64: Manually merge macho64 branch with master branch. 2009-07-08 23:04:52 -05:00
outobj.c Add missing static declarations in output/outobj.c 2014-11-25 12:14:52 -08:00
outobj.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outrdf2.c Replace unchecked fwrite() calls 2014-10-21 12:50:47 -07:00
outrdf2.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outrdf.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
pecoff.h coff: Handle massive relocations 2010-11-20 14:18:23 +03:00
stabs.h Add common STABs definition into output/stabs.h 2010-01-03 15:04:31 +03:00