Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] - Fail the link if something happens on DWARF parsing stage of …
…-gdb-index building This is relative to PR33173, Previously if something wrong happened on DWARF parsers side during parsing object for building gdb index (like was in PR: unsupported relocation) then LLD continued and finished the link. DWARF parsers sure showed error message on their side, but that is all. Patch changes behavior to fail the link in this case and show more detailed message. Differential revision: https://reviews.llvm.org/D34814 llvm-svn: 307370
- Loading branch information
George Rimar
committed
Jul 7, 2017
1 parent
9872a6a
commit 1b51b7f
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# REQUIRES: x86 | ||
# RUN: yaml2obj %s -o %t.o | ||
# RUN: not ld.lld -gdb-index %t.o -o %t.exe 2>&1 | FileCheck %s | ||
|
||
# CHECK: error: {{.*}}.o: error parsing DWARF data: | ||
# CHECK-NEXT: >>> failed to compute relocation: Unknown, Invalid data was encountered while parsing the file | ||
|
||
!ELF | ||
FileHeader: | ||
Class: ELFCLASS32 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_386 | ||
Sections: | ||
- Type: SHT_PROGBITS | ||
Name: .text | ||
Flags: [ ] | ||
AddressAlign: 0x04 | ||
Content: "0000" | ||
- Type: SHT_PROGBITS | ||
Name: .debug_info | ||
Flags: [ ] | ||
AddressAlign: 0x04 | ||
Content: "0000" | ||
- Type: SHT_REL | ||
Name: .rel.debug_info | ||
Link: .symtab | ||
Info: .debug_info | ||
Relocations: | ||
- Offset: 0 | ||
Symbol: _start | ||
Type: 0xFF | ||
- Offset: 4 | ||
Symbol: _start | ||
Type: 0xFF | ||
Symbols: | ||
Global: | ||
- Name: _start | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x0 |