Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] Add mapping symbols to PLT entries
Make PLT entry atoms represent mapping symbols in the Release mode, while in the Debug mode they are still function-like symbols with regular names. It's legal that mapping symbols denote unnamed parts of code, and PLT entries are not required to have function-like names. Differential Revision: http://reviews.llvm.org/D8819 llvm-svn: 234301
- Loading branch information
Denis Protivensky
committed
Apr 7, 2015
1 parent
9dedc77
commit 6c50e88
Showing
2 changed files
with
184 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# Check that mapping symbols are properly generated for PLT entries. | ||
|
||
# RUN: yaml2obj -format=elf -docnum 1 %s > %t-arm.o | ||
# RUN: yaml2obj -format=elf -docnum 2 %s > %t-thm.o | ||
# RUN: lld -flavor gnu -target arm-linux-gnu \ | ||
# RUN: -Bstatic --noinhibit-exec %t-arm.o %t-thm.o -o %t | ||
# RUN: llvm-readobj -symbols %t | FileCheck %s | ||
|
||
# CHECK: Name: {{[$]?[at]?[.]?}}__plt_ifunc_f1 | ||
# CHECK: Name: {{[$]?[at]?[.]?}}__plt_from_thumb_ifunc_f2 | ||
# CHECK: Name: {{[$]?[at]?[.]?}}__plt_ifunc_f2 | ||
|
||
# arm.o | ||
--- | ||
FileHeader: | ||
Class: ELFCLASS32 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_ARM | ||
Flags: [ EF_ARM_EABI_VER5 ] | ||
Sections: | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
AddressAlign: 0x0000000000000004 | ||
Content: 04B02DE500B08DE2003000E3003040E30300A0E100D04BE204B09DE41EFF2FE100482DE904B08DE2FEFFFFEB0030A0E10300A0E10088BDE8 | ||
- Name: .rel.text | ||
Type: SHT_REL | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000004 | ||
Info: .text | ||
Relocations: | ||
- Offset: 0x0000000000000008 | ||
Symbol: main | ||
Type: R_ARM_MOVW_ABS_NC | ||
- Offset: 0x000000000000000C | ||
Symbol: main | ||
Type: R_ARM_MOVT_ABS | ||
- Offset: 0x0000000000000028 | ||
Symbol: f1 | ||
Type: R_ARM_CALL | ||
- Name: .data | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .bss | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
Symbols: | ||
Global: | ||
- Name: f1 | ||
Type: STT_GNU_IFUNC | ||
Section: .text | ||
- Name: main | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x0000000000000020 | ||
|
||
# thm.o | ||
--- | ||
FileHeader: | ||
Class: ELFCLASS32 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_ARM | ||
Flags: [ EF_ARM_EABI_VER5 ] | ||
Sections: | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
AddressAlign: 0x0000000000000004 | ||
Content: 80B400AF40F20003C0F200031846BD465DF8047B704700BF80B500AFFFF7FEFF0346184680BD00BF | ||
- Name: .rel.text | ||
Type: SHT_REL | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000004 | ||
Info: .text | ||
Relocations: | ||
- Offset: 0x0000000000000004 | ||
Symbol: f | ||
Type: R_ARM_THM_MOVW_ABS_NC | ||
- Offset: 0x0000000000000008 | ||
Symbol: f | ||
Type: R_ARM_THM_MOVT_ABS | ||
- Offset: 0x000000000000001C | ||
Symbol: f2 | ||
Type: R_ARM_THM_CALL | ||
- Name: .data | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .bss | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
Symbols: | ||
Global: | ||
- Name: f2 | ||
Type: STT_GNU_IFUNC | ||
Section: .text | ||
Value: 0x0000000000000001 | ||
- Name: f | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x0000000000000019 | ||
... |