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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 08:15:48 PDT 2017


grimar created this revision.

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.


https://reviews.llvm.org/D32647

Files:
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  test/ELF/gdb-index-dup-types.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32647.97103.patch
Type: text/x-patch
Size: 5071 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170428/8243e258/attachment.bin>


More information about the llvm-commits mailing list