summaryrefslogtreecommitdiffstats
path: root/lld/ELF/GdbIndex.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename GdbIndex.{cpp,h} -> DWARF.{cpp,h}.Rui Ueyama2018-09-141-101/+0
| | | | | | | | These files used to contain classes and functions for .gdb_index, but they are moved to SyntheticSections.{cpp,h}, so the name is now irrelevant. llvm-svn: 342299
* s/uncompress/decompress/g.Rui Ueyama2018-02-121-1/+1
| | | | | | | In lld, we use both "uncompress" and "decompress" which is confusing. Since LLVM uses "decompress", we should use the same term. llvm-svn: 324944
* Remove some includes from InputFiles.h.Rafael Espindola2017-12-091-0/+1
| | | | | | | They were not used in InputFiles.h and it was getting too easy to add circular includes. llvm-svn: 320256
* Error instead of ignoring broken debug info.Rafael Espindola2017-11-301-2/+4
| | | | | | Thanks to Davide for noticing. llvm-svn: 319401
* Don't crash on broken debug info.Rafael Espindola2017-11-291-5/+8
| | | | llvm-svn: 319367
* Move Memory.{h,cpp} to Common.Rui Ueyama2017-11-281-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D40571 llvm-svn: 319221
* [ELF] - Teach LLD to use information from .debug_str for error reporting.George Rimar2017-11-171-0/+2
| | | | | | | | | | | | Recently we teached LLD to report line numbers for duplicate variables definitions, though currently LLD is unable to do that for case when strings are not built in .debug_info, but stored in .debug_str instead. That is because out LLDDwarfObj does not handle .debug_str yet. Patch fixes that. Differential revision: https://reviews.llvm.org/D39542 llvm-svn: 318519
* ELF: Merge DefinedRegular and Defined.Peter Collingbourne2017-11-061-1/+1
| | | | | | | | | Now that DefinedRegular is the only remaining derived class of Defined, we can merge the two classes. Differential Revision: https://reviews.llvm.org/D39667 llvm-svn: 317448
* Revert "[ELF] - Teach LLD to use information from .debug_str for error ↵Bob Haarman2017-11-031-2/+0
| | | | | | | | | | reporting." This reverts commit 00b7acb8f6c8a4663bb7c8396d217c210209b562. It was causing some links to execute llvm_unreachable. llvm-svn: 317378
* Rename SymbolBody -> SymbolRui Ueyama2017-11-031-1/+1
| | | | | | | | | | | | | Now that we have only SymbolBody as the symbol class. So, "SymbolBody" is a bit strange name now. This is a mechanical change generated by perl -i -pe s/SymbolBody/Symbol/g $(git grep -l SymbolBody lld/ELF lld/COFF) nd clang-format-diff. Differential Revision: https://reviews.llvm.org/D39459 llvm-svn: 317370
* [ELF] - Teach LLD to use information from .debug_str for error reporting.George Rimar2017-11-031-0/+2
| | | | | | | | | | | | Recently we teached LLD to report line numbers for duplicate variables definitions, though currently LLD is unable to do that for case when strings are not built in .debug_info, but stored in .debug_str instead. That is because out LLDDwarfObj does not handle .debug_str yet. Patch fixes that. Differential revision: https://reviews.llvm.org/D39542 llvm-svn: 317305
* [ELF] Decompress debug info sections earlyShoaib Meenai2017-10-041-0/+1
| | | | | | | | | | | | | | | | | | When reporting a symbol conflict, LLD parses the debug info to report source location information. Sections have not been decompressed at this point, so if an object file contains zlib compressed debug info, LLD ends up passing this compressed debug info to the DWARF parser, which causes debug info parsing failures and can trigger assertions in the parser (as the test case demonstrates). Decompress debug sections when constructing the LLDDwarfObj to avoid this issue. This doesn't handle GNU-style compressed debug info sections (.zdebug_*), which at present are simply ignored by LLDDwarfObj; those can be done in a follow-up. Differential Revision: https://reviews.llvm.org/D38491 llvm-svn: 314866
* Remove unused member variable.Rui Ueyama2017-09-241-2/+1
| | | | llvm-svn: 314087
* Refactor GdbIndexSection. NFC.Rui Ueyama2017-09-241-24/+0
| | | | | | | | | | | | | | | | | | | This patch rewrites a part of GdbIndexSection to address the following issues in the previous implementation: - Previously, some struct declarations were in GdbIndex.h while they were not used in GdbIndex.cpp. Such structs are moved to SyntheticSection.h. - The actual implementation were split into GdbIndexSection and GdbHash section, but that separation didn't make much sense. They are now unified as GdbIndexSection. In addition to the above changes, this patch splits functions, rename variables and remove redundant functions/variables to generally improve code quality. llvm-svn: 314084
* Use more consistent namesRafael Espindola2017-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | Reviewing another change I noticed that we use "getSymbols" to mean different things in different files. Depending on the file it can return ArrayRef<StringRef> ArrayRef<SymbolBody*> ArrayRef<Symbol*> ArrayRef<Elf_Sym> With this change it always returns an ArrayRef<SymbolBody*>. The other functions are renamed getELFsyms() and getSymbolNames(). Note that we cannot return ArrayRef<Symbol*> instead of ArreyRef<SymbolBody*> because local symbols have a SymbolBody but not a Symbol. llvm-svn: 309840
* Remove a redundant temporary variable.Rui Ueyama2017-08-011-2/+1
| | | | llvm-svn: 309654
* Binary search to find a relocation.Rui Ueyama2017-08-011-4/+6
| | | | | | | | This change makes -gdb-index 40% faster. My test case is self-linking lld. Differential Revision: https://reviews.llvm.org/D36079 llvm-svn: 309652
* Rename ObjectFile -> ObjFile.Rui Ueyama2017-07-261-2/+2
| | | | | | | Rename it because it was too easy to conflict with llvm::object::ObjectFile which broke buildbots several times. llvm-svn: 309199
* Speed up gdb index creation.Rafael Espindola2017-07-191-0/+67
| | | | | | | | | | | With that in place we can use lld's own infrastructure for the low level detail of dwarf parsing. With this we don't decompress sections twice, we don't scan all realocations and even with this simplistic implementation linking clang with gdb index goes from 34.09 seconds to 20.80 seconds. llvm-svn: 308544
* Remove a comment that is taken from gdb man page.Rui Ueyama2017-03-291-48/+4
| | | | | | | This is not an original comment but taken from gdb man page, so a pointer to the original document should suffice. llvm-svn: 298964
* Simplify. NFC.Rui Ueyama2017-03-021-13/+8
| | | | llvm-svn: 296773
* Split GdbIndexBuilder class into non-member functions.Rui Ueyama2017-03-011-88/+0
| | | | | | | | | | | | That class had three member functions, and all of them are just reader methods that did not depend on class members, so they can be just non- member functions. Probably we should reorganize the functions themselves because their return types doesn't make much sense to me, but for now I just moved these functions out of the class. llvm-svn: 296700
* Remove useless variables and declarations.Rui Ueyama2017-03-011-2/+1
| | | | llvm-svn: 296695
* Replace `auto` with its real type.Rui Ueyama2017-03-011-1/+1
| | | | llvm-svn: 296694
* Style fix.Rui Ueyama2017-03-011-8/+5
| | | | llvm-svn: 296689
* Reduce nesting. NFC.Rui Ueyama2017-03-011-7/+8
| | | | llvm-svn: 296688
* Do not inherit LoadedObjectInfo.Rui Ueyama2017-03-011-18/+15
| | | | | | GdbIndexBuilder class inherited LoadedObjectInfo, but that's not necessary. llvm-svn: 296687
* Unbreak Windows bots.Rui Ueyama2017-03-011-1/+1
| | | | llvm-svn: 296680
* Don't implement the gdb hash table as a generic in-memory hash table.Rui Ueyama2017-03-011-39/+24
| | | | | | | | | | | | | | | | | | Looks like .gdb.index and its support classes do things that they don't have to or shouldn't do do. This patch addresses one of these issues. GdbHashTab class is a hash table class. Just like other in-memory hash tables, that incrementally updates its internal data and resizes buckets as new elements are added so that key lookup is always fast. But that is completely not necessary. Unlike debuggers, we only produce hash tables for .gdb.index and never read them. So incrementally updating a hash table in memory is just a waste of resource and complicates the code. What we should do is to accumulate symbols and then create the final hash table at once. llvm-svn: 296678
* Make InputSection a class. NFC.Rafael Espindola2017-02-231-2/+2
| | | | | | | | | With the current design an InputSection is basically anything that goes directly in a OutputSection. That includes plain input section but also synthetic sections, so this should probably not be a template. llvm-svn: 295993
* Convert InputSectionBase to a class.Rafael Espindola2017-02-231-9/+11
| | | | | | | Removing this template is not a big win by itself, but opens the way for removing more templates. llvm-svn: 295923
* [ELF] - Return file offset as address only for allocatable sections when ↵George Rimar2016-12-231-1/+6
| | | | | | | | | | building .gdb_index This fixes issue revealed by r289961. Differential revision: https://reviews.llvm.org/D28045 llvm-svn: 290419
* [ELF] - Use DWARFDebugPubTable parser class intead of hand-written parsing.George Rimar2016-12-171-16/+5
| | | | | | | DWARFDebugPubTable was introduced recently and allows us to get rid of code duplication in LLD. llvm-svn: 290042
* [ELF] - Partial support of --gdb-index command line option (Part 3).George Rimar2016-12-151-5/+74
| | | | | | | | | | | | | Patch continues work started in D24706 and D25821. in this patch symbol table and constant pool areas were added to .gdb_index section output. This one finishes the implementation of --gdb-index functionality in LLD. Differential revision: https://reviews.llvm.org/D26283 llvm-svn: 289810
* [ELF] - Partial support of --gdb-index command line option (Part 2).George Rimar2016-12-151-22/+62
| | | | | | | | | | Patch continues work started in D24706, in this patch address area was added to .gdb_index section output. Differential revision: https://reviews.llvm.org/D25821 llvm-svn: 289790
* Define toString() as a generic function to get a string for error message.Rui Ueyama2016-11-231-2/+1
| | | | | | | | | | | | | | | We have different functions to stringize objects to construct error messages. For InputFile, we have getFilename, and for InputSection, we have getName. You had to memorize them. I think this is the case where the function overloading comes in handy. This patch defines toString() functions that are overloaded for all these types, so that you just call it in error(). Differential Revision: https://reviews.llvm.org/D27030 llvm-svn: 287787
* [ELF] - Partial support of --gdb-index command line option (Part 1).George Rimar2016-10-201-0/+103
In this patch partial gdb_index section is created. For costructing the .gdb_index section 6 steps should be performed (details are in SplitDebugInfo.cpp file header), this patch do first 3: Creates proper section header. Fills list of compilation units. Types CU list area is not supposed to be supported, so it is ignored and therefore can be treated as implemented either. Differential revision: https://reviews.llvm.org/D24706 llvm-svn: 284708
OpenPOWER on IntegriCloud