[PATCH] D24267: [ELF] - Added support of --gdb-index command line option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 09:48:24 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.

Large applications compiled with debug information experience slow link times, possible out-of-memory conditions at link time, and slow gdb startup times. In addition, they can contribute to significant increases in storage requirements, and additional network latency when transferring files in a distributed build environment.

gold linker supports gdb-index option to solve this:

Use the gold linker's --gdb-index option (-Wl,--gdb-index when linking with gcc or g++) at link time to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them. It is used in combination with gcc -gsplit-dwarf option to enable the generation of split DWARF at compile time.

This patch is initial implementation of feature above. At this stage it is able to generate .gdb_index section for trivial helloworld application. Most of work is already done though I think.
Testcase uses object file produced by gcc for demonstration. Contents of .gdb_index produced by gold and lld are almost fully equal (string name offsets are different, which is expected and fine I believe).

There is no many information about the feature, so next sources were used as reference:
* gold source code.
* GDB 's "Appendix J .gdb_index section format" (https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html).
* DWARF Debugging Information Format (http://www.dwarfstd.org/doc/DWARF4.pdf).


https://reviews.llvm.org/D24267

Files:
  ELF/CMakeLists.txt
  ELF/Config.h
  ELF/Driver.cpp
  ELF/InputFiles.cpp
  ELF/InputFiles.h
  ELF/Options.td
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/SplitDebugInfo.cpp
  ELF/SplitDebugInfo.h
  ELF/Writer.cpp
  test/ELF/Inputs/gdb-index-a.elf
  test/ELF/Inputs/gdb-index-b.elf
  test/ELF/gdb-index.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24267.70421.patch
Type: text/x-patch
Size: 40738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160906/478b8631/attachment.bin>


More information about the llvm-commits mailing list