summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/undef-broken-debug.test
Commit message (Collapse)AuthorAgeFilesLines
* Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the ↵Fangrui Song2019-06-261-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sections were discarded This restores r361830 "[ELF] Error on relocations to STT_SECTION symbols if the sections were discarded" and dependent commits (r362218, r362497) which were reverted by r364321, with a fix of a --gdb-index issue. .rela.debug_ranges contains relocations of range list entries: // start address of a range list entry // old: 0; after r361830: 0 00000000000033a0 R_X86_64_64 .text._ZN2v88internal7Isolate7factoryEv + 0 // end address of a range list entry // old: 0xe; after r361830: 0 00000000000033a8 R_X86_64_64 .text._ZN2v88internal7Isolate7factoryEv + e If both start and end addresses of a range list entry resolve to 0, DWARFDebugRangeList::isEndOfListEntry() will return true, then the .debug_range decoding loop will terminate prematurely: while (true) { decode StartAddress decode EndAddress if (Entry.isEndOfListEntry()) // prematurely break; Entries.push_back(Entry); } In lld/ELF/SyntheticSections.cpp, readAddressAreas() will read incomplete address ranges and the resulting .gdb_index will be incomplete. For files that gdb hasn't loaded their debug info, gdb uses .gdb_index to map addresses to CUs. The absent entries make gdb fail to symbolize some addresses. To address this issue, we simply allow relocations to undefined symbols in DWARF.cpp:findAux() and let RelocationResolver resolve them. This patch should fix: [1] http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190603/659848.html [2] https://bugs.chromium.org/p/chromium/issues/detail?id=978067 llvm-svn: 364391
* [ELF] Initialize Target before it may be dereferenced by findAux when ↵Fangrui Song2019-05-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | reporting "duplicate symbol" error for (InputFile *F : Files) Symtab->addFile<ELFT>(F); // if there is a duplicate symbol error ... Target = getTarget(); When parsing .debug_info in the object file (for better diagnostics), DWARF.cpp findAux may dereference the null pointer Target auto *DR = dyn_cast<Defined>(&File->getRelocTargetSym(Rel)); if (!DR) { // Broken debug info may point to a non-defined symbol, // some asan object files may also contain R_X86_64_NONE RelType Type = Rel.getType(Config->IsMips64EL); if (Type != Target->NoneRel) /// Target is null Move the assignment of Target to an earlier place to fix this. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D61712 llvm-svn: 360305
* [LLD] - Update the test cases after yaml2obj change.George Rimar2019-04-031-11/+11
| | | | | | | | | https://reviews.llvm.org/D60122 (r357595) changed the symbols description format. This change updates the LLD tests. llvm-svn: 357596
* [ELF][test]Remove unnecessary empty symbol references in yaml/add missing ↵James Henderson2019-02-221-0/+7
| | | | | | | | | | | | | | | | | | | symbols for relocs yaml2obj used to require the Symbol field in relocations, but it hasn't done so for a couple of years. Another change to yaml2obj will soon land that will look up the symbol by name or index, if present, and emit an error if not found. This will mean that an explicit symbol reference (even to an empty-named symbol) that does not reference a symbol declared in the yaml will result in an error. This patch updates tests that would otherwise start emitting errors. Reviewed by: ruiu, grimar Differential Revision: https://reviews.llvm.org/D58508 llvm-svn: 354666
* [ELF] - Do not fail on R_*_NONE relocations when parsing the debug info.George Rimar2018-09-261-1/+1
| | | | | | | | | | | | | | | | | This is https://bugs.llvm.org//show_bug.cgi?id=38919. Currently, LLD may report "unsupported relocation target while parsing debug info" when parsing the debug information. At the same time LLD does that for zeroed R_X86_64_NONE relocations, which obviously has "invalid" targets. The nature of R_*_NONE relocation assumes them should be ignored. This patch teaches LLD to stop reporting the debug information parsing errors for them. Differential revision: https://reviews.llvm.org/D52408 llvm-svn: 343078
* [ELF] Replace unused output filenames with /dev/null in testsFangrui Song2018-07-021-1/+1
| | | | | | Post commit review at rLLD335992 llvm-svn: 336129
* Make the debug info in some tests more realistic.Rafael Espindola2018-03-221-0/+21
| | | | | | | | | | | | | | | | | | | Currently lld just parses the .debug_line section assuming that there is only one compile unit. That assumption is false (PR36793). I have a patch that changes lld to iterate over the compile units and parse the portions of the .debug_line they point to (which fixes PR36793). A problem is that we will then need a compiler unit pointing to .debug_line for lld to see it. It seems like bfd has the same restriction. This patch updates existing tests to add a minimal compile unit so that they still work with PR36793 fixed. llvm-svn: 328215
* Error instead of ignoring broken debug info.Rafael Espindola2017-11-301-0/+1
| | | | | | Thanks to Davide for noticing. llvm-svn: 319401
* Fix reloc section alignment in test.Rafael Espindola2017-11-291-0/+2
| | | | | | | | | This should fix the ubsan bot. We still have to fix lld to produce a clean error on unaligned reloc sections. llvm-svn: 319385
* Don't crash on broken debug info.Rafael Espindola2017-11-291-0/+44
llvm-svn: 319367
OpenPOWER on IntegriCloud