mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-09 08:07:30 +00:00
On ppc64, the value of a function symbol is *usually* the pointer to the function. That function pointer value refers to an index inside the ".opd" (Official Procedure Descriptor) section. That section is a record of tripplets values. One of these values is the address of the entry point of the function. A debug information entry for a function, in DWARF, refers to the entry point of the function; not to the function pointer address. So libabigail builds a table that associates a function entry point address to its function pointer address. So, if a function is named "foo", it has an entry in the symbol table for the symbol name "foo"; the value of that symbol is the function pointer address of foo, which refers to an offset in the ".opd" section. But then it turns out that there is also going to be an entry in the symbol table for an artificial symbol named ".foo". Pleast note the dot before the suffix "foo". The value of the ".foo" symbol is the address of the entry point of the function "foo"; it's an address in the ".text" section this time. Libabigail's ELF symbols reading code was (wrongly) expecting all entries in the symbol table that refer to function to have values that are offset in the ".opd" section. It wasn't expecting the ".foo" symbols whose value are an address in the ".text" section. This patch fixes the ELF symbol reading code to make it be aware of the ".foo" symbols too. * abg-dwarf-reader.cc (read_context::find_opd_section): Fix comment. (read_context::load_symbol_maps): If for a given function entry point (that we got by looking at the ".opd" section for a given function pointer value) we already had an entry in the function_entry_address -> symbol, maybe it means that the previous entry that we had was from an entry in the symbol table which value was directly the entry point address of a function. In that case, if the name of the symbol is "foo", the name of the symbol which value is directly the entry point address is ".foo". What we do in this case is that we just keep the reference to the "foo" symbol in the function_entry_address -> symbol map. (read_context::address_is_in_opd_section): Define new member function. * tests/data/test-diff-pkg/gmp-4.3.1-10.el6.ppc64.rpm: New test input. * tests/data/test-diff-pkg/gmp-4.3.1-7.el6_2.2.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/gmp-debuginfo-4.3.1-10.el6.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/gmp-debuginfo-4.3.1-7.el6_2.2.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/gmp-4.3.1-7.el6_2.2.ppc64--gmp-4.3.1-10.el6.ppc64-report-0.txt: New test reference output. * tests/data/Makefile.am: Add the new test input and reference output to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the new test inputs and reference output to the set of inputs that are compared. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
data | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestfedabipkgdiff.py.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-core-diff.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-ir-walker.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
test-write-read-archive.cc | ||
update-test-output.py |