libdwarf: Add symbol value when processing .rela relocations

Reviewed by:	kib, rpaulo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1826
This commit is contained in:
Ed Maste 2015-02-11 19:53:44 +00:00
parent b5263b26db
commit f4bfb1fc59
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278593

View file

@ -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);
}
}