This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not produce duplicate values in .gdb_index's constant pool area.
ClosedPublic

Authored by grimar on Apr 28 2017, 8:15 AM.

Details

Summary

I found this when builded llc binary using gcc 5.4.1 + LLD.
gcc produces duplicate entries in .debug_gnu_pubtypes section, ex:

UnifyFunctionExitNodes.cpp.o has:
0x0000ac07 EXTERNAL TYPE "std::success_type<void*>"
0x0000ac07 EXTERNAL TYPE "std::
success_type<void*>"

clang produces single entry here:
0x0000d291 EXTERNAL TYPE "std::__success_type<void *>"

If we link output from gcc with LLD, that would produce excessive duplicate
entries in .gdb_index constant pool area. That does not seem affect gdb work,
but makes .gdb_index larger than it can be.

I also checked that gold filters out such duplicates too.

Patch fixes the issue and also simplifies how we store CU index + attributes,
previously they were stored separatelly, that doesn't make sense.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Apr 28 2017, 8:15 AM
grimar added a comment.May 4 2017, 6:14 AM

Latest available release of GCC (7.1.0) is also affected: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80628

grimar updated this revision to Diff 97944.May 5 2017, 5:53 AM
  • Addressed review comments.

Rui, that had LGTM from Rafael about a week ago. Do you have objections about landing this ?

ruiu accepted this revision.May 25 2017, 1:35 PM

LGTM

This revision is now accepted and ready to land.May 25 2017, 1:35 PM
This revision was automatically updated to reflect the committed changes.