diff options
author | emaste <emaste@FreeBSD.org> | 2015-02-11 19:53:44 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-02-11 19:53:44 +0000 |
commit | 3f099bf4f1149965f4a38766a149eeada43f3bf9 (patch) | |
tree | 9d1431063a8f91f7395f97cd05dfe7e7a4c20921 /contrib/elftoolchain/libdwarf | |
parent | a306f93a8582cb349af0d62bc3aa88361fc65622 (diff) | |
download | FreeBSD-src-3f099bf4f1149965f4a38766a149eeada43f3bf9.zip FreeBSD-src-3f099bf4f1149965f4a38766a149eeada43f3bf9.tar.gz |
libdwarf: Add symbol value when processing .rela relocations
Reviewed by: kib, rpaulo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1826
Diffstat (limited to 'contrib/elftoolchain/libdwarf')
-rw-r--r-- | contrib/elftoolchain/libdwarf/libdwarf_elf_init.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c b/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c index 1e374f2..2ed48eb 100644 --- a/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c +++ b/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c @@ -70,11 +70,15 @@ _dwarf_elf_apply_reloc(Dwarf_Debug dbg, void *buf, Elf_Data *rel_data, offset = rela.r_offset; size = _dwarf_get_reloc_size(dbg, type); + if (size == 0) + continue; /* Unknown or non-absolute relocation. */ if (endian == ELFDATA2MSB) - _dwarf_write_msb(buf, &offset, rela.r_addend, size); + _dwarf_write_msb(buf, &offset, + sym.st_value + rela.r_addend, size); else - _dwarf_write_lsb(buf, &offset, rela.r_addend, size); + _dwarf_write_lsb(buf, &offset, + sym.st_value + rela.r_addend, size); } } |