When looking at ELF file of the ET_REL kind (i.e, relocatable object
files), several kinds of symbols (for instance weak symbols) can have
the symbol value zero. Although they have the same value, the fact
that that value is zero prevents us from considering those symbols as
being aliases.
Libabigail was wrongly considering those symbols with value zero as
being aliases. So, in practice, it was considering all WEAK symbols
as being aliases, because the value of a weak symbols is zero.
When comparing two binaries originating from the same source code, one
compiled with g++ and the other one compiled with clang++, abidiff was
thus reporting spurious function aliases changes due to this issue.
Note that the two binaries in question come from the bug PR21486.
Comparing them using abidiff exhibits several other issues that were
fixed in previous commits, such as
- Reporting changes about top cv qualifier changes on function
parameter types.
- Not supporting ELF symbol visibility
* src/abg-dwarf-reader.cc (load_symbol_maps_from_symtab_section):
Do not consider symbols with zero value as being aliases.
* tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust.
* tests/data/test-diff-filter/test20-inline-report-1.txt:
Likewise.
* test-diff-filter/test41-PR21486-abg-writer.gcc.o: New test
binary input.
* tests/data/test-diff-filter/test41-PR21486-abg-writer.llvm.o:
Likewise.
* tests/data/Makefile.am: Add the new test material to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Run the test harness
on the new test input above.
* tests/data/test-diff-dwarf/test5-report.txt: Adjust.
* tests/data/test-diff-filter/test9-report.txt: Adjust.
* tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust.
* tests/data/test-diff-filter/test20-inline-report-1.txt: Adjust.