Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a relocation to ObjectFileELF::ApplyRelocations and a test
Summary: pcm files can end up being processed by lldb with relocations to be made for the .debug_info section. When a R_AARCH64_ABS64 relocation was required lldb would hit an `assert(false)` and die. Add R_AARCH64_ABS64 relocations to the S+A 64 bit width code path. Add a test for R_AARCH64_ABS64 and R_AARCH64_ABS32 .rela.debug_info relocations in a pcm file. Reviewers: sas, xiaobai, davide, javed.absar, espindola Reviewed By: davide Subscribers: labath, zturner, emaste, mgorny, arichardson, kristof.beyls Differential Revision: https://reviews.llvm.org/D51566 llvm-svn: 346171
- Loading branch information
Showing
4 changed files
with
252 additions
and
3 deletions.
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
183 changes: 183 additions & 0 deletions
183
lldb/unittests/ObjectFile/ELF/Inputs/debug-info-relocations.pcm.yaml
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,183 @@ | ||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_AARCH64 | ||
Sections: | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
AddressAlign: 0x0000000000000004 | ||
Content: E0031B32C0035FD6 | ||
- Name: .debug_str | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_MERGE, SHF_STRINGS ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: 636C616E672076657273696F6E20362E302E312028746167732F52454C454153455F3630312F66696E616C2900726564756365642E68002F746D702F617364666173646673646661006600696E7400 | ||
- Name: .debug_abbrev | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: 011101250E1305030E10171B0EB44219110112060000022E00110112064018030E3A0B3B0B271949133F190000032400030E3E0B0B0B000000 | ||
- Name: .debug_info | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: 470000000400000000000801000000000C0000000000000000000000000000000000000000000800000002000000000000000008000000016F000000000102430000000300000000050400 | ||
- Name: .rela.debug_info | ||
Type: SHT_RELA | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000008 | ||
Info: .debug_info | ||
Relocations: | ||
- Offset: 0x0000000000000006 | ||
Symbol: .debug_abbrev | ||
Type: R_AARCH64_ABS32 | ||
- Offset: 0x000000000000000C | ||
Symbol: .debug_str | ||
Type: R_AARCH64_ABS32 | ||
- Offset: 0x0000000000000012 | ||
Symbol: .debug_str | ||
Type: R_AARCH64_ABS32 | ||
Addend: 45 | ||
- Offset: 0x0000000000000016 | ||
Symbol: .debug_line | ||
Type: R_AARCH64_ABS32 | ||
- Offset: 0x000000000000001A | ||
Symbol: .debug_str | ||
Type: R_AARCH64_ABS32 | ||
Addend: 55 | ||
- Offset: 0x000000000000001E | ||
Symbol: .text | ||
Type: R_AARCH64_ABS64 | ||
- Offset: 0x000000000000002B | ||
Symbol: .text | ||
Type: R_AARCH64_ABS64 | ||
- Offset: 0x0000000000000039 | ||
Symbol: .debug_str | ||
Type: R_AARCH64_ABS32 | ||
Addend: 73 | ||
- Offset: 0x0000000000000044 | ||
Symbol: .debug_str | ||
Type: R_AARCH64_ABS32 | ||
Addend: 75 | ||
- Name: .debug_ranges | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .debug_macinfo | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: '00' | ||
- Name: .debug_pubnames | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: 140000000200000000004B0000002A000000660000000000 | ||
- Name: .rela.debug_pubnames | ||
Type: SHT_RELA | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000008 | ||
Info: .debug_pubnames | ||
Relocations: | ||
- Offset: 0x0000000000000006 | ||
Symbol: .debug_info | ||
Type: R_AARCH64_ABS32 | ||
- Name: .debug_pubtypes | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: 160000000200000000004B00000043000000696E740000000000 | ||
- Name: .rela.debug_pubtypes | ||
Type: SHT_RELA | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000008 | ||
Info: .debug_pubtypes | ||
Relocations: | ||
- Offset: 0x0000000000000006 | ||
Symbol: .debug_info | ||
Type: R_AARCH64_ABS32 | ||
- Name: .comment | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_MERGE, SHF_STRINGS ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: 00636C616E672076657273696F6E20362E302E312028746167732F52454C454153455F3630312F66696E616C2900 | ||
- Name: .note.GNU-stack | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .debug_frame | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000008 | ||
Content: 14000000FFFFFFFF04000800017C1E0C1F00000000000000140000000000000000000000000000000800000000000000 | ||
- Name: .rela.debug_frame | ||
Type: SHT_RELA | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000008 | ||
Info: .debug_frame | ||
Relocations: | ||
- Offset: 0x000000000000001C | ||
Symbol: .debug_frame | ||
Type: R_AARCH64_ABS32 | ||
- Offset: 0x0000000000000020 | ||
Symbol: .text | ||
Type: R_AARCH64_ABS64 | ||
- Name: .debug_line | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: 3C000000040021000000010101FB0E0D00010101010000000100000100726564756365642E68000000000000090200000000000000001305030A4B0204000101 | ||
- Name: .rela.debug_line | ||
Type: SHT_RELA | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000008 | ||
Info: .debug_line | ||
Relocations: | ||
- Offset: 0x000000000000002E | ||
Symbol: .text | ||
Type: R_AARCH64_ABS64 | ||
Symbols: | ||
Local: | ||
- Name: reduced.h | ||
Type: STT_FILE | ||
- Name: '$d.1' | ||
Section: .debug_str | ||
- Name: '$d.2' | ||
Section: .debug_abbrev | ||
- Name: '$d.3' | ||
Section: .debug_info | ||
- Name: '$d.4' | ||
Section: .debug_macinfo | ||
- Name: '$d.5' | ||
Section: .debug_pubnames | ||
- Name: '$d.6' | ||
Section: .debug_pubtypes | ||
- Name: '$d.7' | ||
Section: .comment | ||
- Name: '$d.8' | ||
Section: .debug_frame | ||
- Name: '$d.9' | ||
Section: .debug_line | ||
- Name: '$x.0' | ||
Section: .text | ||
- Name: .text | ||
Type: STT_SECTION | ||
Section: .text | ||
- Name: .debug_str | ||
Type: STT_SECTION | ||
Section: .debug_str | ||
- Name: .debug_abbrev | ||
Type: STT_SECTION | ||
Section: .debug_abbrev | ||
- Name: .debug_info | ||
Type: STT_SECTION | ||
Section: .debug_info | ||
- Name: .debug_frame | ||
Type: STT_SECTION | ||
Section: .debug_frame | ||
- Name: .debug_line | ||
Type: STT_SECTION | ||
Section: .debug_line | ||
Global: | ||
- Name: f | ||
Type: STT_FUNC | ||
Section: .text | ||
Size: 0x0000000000000008 | ||
DynamicSymbols: | ||
... |
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