From: Petr Machata Date: Tue, 21 Apr 2009 11:45:41 +0000 (+0200) Subject: dwarflint: Don't actually relocate values in non-ET_REL files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4925809503aca46986d7488e2914eba241165699;p=thirdparty%2Felfutils.git dwarflint: Don't actually relocate values in non-ET_REL files * still do all the checking, just skip actual relocation computation --- diff --git a/src/dwarflint.c b/src/dwarflint.c index 675de71c7..d289ab06e 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -2648,8 +2648,6 @@ relocate_one (struct relocation_data *reloc, struct relocation *rel, sym_value = reloc->file->sec[section_index].shdr.sh_addr; } - *value = rel->addend + sym_value; - /* It's target value, not section offset. */ if (offset_into == rel_value || offset_into == rel_address @@ -2717,6 +2715,15 @@ relocate_one (struct relocation_data *reloc, struct relocation *rel, free (wh1); } } + + /* Only do the actual relocation if we have ET_REL files. For + non-ET_REL files, only do the above checking. */ + if (reloc->file->ehdr.e_type == ET_REL) + { + *value = rel->addend + sym_value; + if (rel_width == 4) + *value = *value & (uint64_t)(uint32_t)-1; + } } }