Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] Implement relocations: R_ARM_REL32, R_ARM_THM_JUMP11, R_ARM_PREL31
Test case for every relocation is added. Differential Revision: http://reviews.llvm.org/D7565 llvm-svn: 232464
- Loading branch information
Denis Protivensky
committed
Mar 17, 2015
1 parent
b326765
commit e458ab4
Showing
4 changed files
with
367 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,48 @@ | ||
# Check handling of R_ARM_PREL31 relocation. | ||
# RUN: yaml2obj -format=elf %s > %t-o.o | ||
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \ | ||
# RUN: --noinhibit-exec %t-o.o -o %t | ||
# RUN: llvm-objdump -s -t %t | FileCheck %s | ||
|
||
# CHECK: Contents of section .ARM.extab: | ||
# CHECK: 4000a4 b1ffff7f | ||
# CHECK: SYMBOL TABLE: | ||
# CHECK: 00000000 *UND* 00000000 | ||
# CHECK: 00400054 g F .text 00000050 __gxx_personality_v0 | ||
|
||
--- | ||
FileHeader: | ||
Class: ELFCLASS32 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_ARM | ||
Flags: [ EF_ARM_EABI_VER5 ] | ||
Sections: | ||
- Name: .ARM.extab | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC ] | ||
AddressAlign: 0x4 | ||
Content: 0000000084019701B0B0B008FFFF01080E2432003A040000 | ||
- Name: .rel.ARM.extab | ||
Type: SHT_REL | ||
Link: .symtab | ||
AddressAlign: 0x4 | ||
Info: .ARM.extab | ||
Relocations: | ||
- Offset: 0 | ||
Symbol: __gxx_personality_v0 | ||
Type: R_ARM_PREL31 | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
AddressAlign: 0x4 | ||
Content: 80B400AF00231846BD465DF8047B704780B582B000AF3B1D1846FFF7FEFFFFF7FEFFFFF7FEFF0420FFF7FEFF0346184601230360002240F20001C0F20001FFF7FEFF3B1D1846FFF7FEFFFFF7FEFF00BF | ||
Symbols: | ||
Local: | ||
Global: | ||
- Name: __gxx_personality_v0 | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x1 | ||
... | ||
|
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,97 @@ | ||
# Check handling of R_ARM_REL32 relocation. | ||
# RUN: yaml2obj -format=elf %s > %t-o.o | ||
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \ | ||
# RUN: --noinhibit-exec %t-o.o -o %t | ||
# RUN: llvm-objdump -s -t %t | FileCheck %s | ||
|
||
# CHECK: Contents of section .text: | ||
# CHECK-NEXT: 400074 80b400af 880f0000 | ||
# CHECK: SYMBOL TABLE: | ||
# CHECK: 00400074 g F .text 00000004 main | ||
# CHECK: 00401000 g .bss 00000004 _myref | ||
|
||
--- | ||
--- | ||
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: 80B400AF0000000000231846BD465DF8047B7047 | ||
- Name: .rel.text | ||
Type: SHT_REL | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000004 | ||
Info: .text | ||
Relocations: | ||
- Offset: 0x0000000000000004 | ||
Symbol: _myref | ||
Type: R_ARM_REL32 | ||
- Name: .data | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .bss | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000004 | ||
Content: '00474343' | ||
- Name: .comment | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_MERGE, SHF_STRINGS ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: 004743433A202863726F7373746F6F6C2D4E47206C696E61726F2D312E31332E312D342E392D323031342E3039202D204C696E61726F2047434320342E392D323031342E30392920342E392E32203230313430393034202870726572656C656173652900 | ||
- Name: .note.GNU-stack | ||
Type: SHT_PROGBITS | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
- Name: .ARM.attributes | ||
Type: SHT_ARM_ATTRIBUTES | ||
AddressAlign: 0x0000000000000001 | ||
Content: 4134000000616561626900012A00000005372D4100060A0741080109020A041204140115011703180119011A021B031C011E062201 | ||
Symbols: | ||
Local: | ||
- Name: test.c | ||
Type: STT_FILE | ||
- Name: .text | ||
Type: STT_SECTION | ||
Section: .text | ||
- Name: .data | ||
Type: STT_SECTION | ||
Section: .data | ||
- Name: .bss | ||
Type: STT_SECTION | ||
Section: .bss | ||
- Name: '$d' | ||
Section: .text | ||
Value: 0x0000000000000004 | ||
- Name: '$t' | ||
Section: .text | ||
Value: 0x0000000000000008 | ||
- Name: .note.GNU-stack | ||
Type: STT_SECTION | ||
Section: .note.GNU-stack | ||
- Name: .comment | ||
Type: STT_SECTION | ||
Section: .comment | ||
- Name: .ARM.attributes | ||
Type: STT_SECTION | ||
Section: .ARM.attributes | ||
Global: | ||
- Name: _myref | ||
Type: STT_OBJECT | ||
Section: .bss | ||
Size: 0x0000000000000004 | ||
- Name: main | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x0000000000000001 | ||
Size: 0x0000000000000014 | ||
... |
Oops, something went wrong.