-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] Implementation of R_ARM_TARGET1 relocation
This patch provides implementation of R_ARM_TARGET1 relocation with configuration of its behaviour from a command line. This patch provides two command line options for GnuLd driver: --arm-target1-rel and --arm-target1-abs (similar to ld option names with extra prefix 'arm-'). So user may choose which behaviour of R_ARM_TARGET1 is preferred for his implementation of libc. Differential Revision: http://reviews.llvm.org/D8707 llvm-svn: 234009
- llvmorg-20-init
- llvmorg-19.1.7
- llvmorg-19.1.6
- llvmorg-19.1.5
- llvmorg-19.1.4
- llvmorg-19.1.3
- llvmorg-19.1.2
- llvmorg-19.1.1
- llvmorg-19.1.0
- llvmorg-19.1.0-rc4
- llvmorg-19.1.0-rc3
- llvmorg-19.1.0-rc2
- llvmorg-19.1.0-rc1
- llvmorg-19-init
- llvmorg-18.1.8
- llvmorg-18.1.7
- llvmorg-18.1.6
- llvmorg-18.1.5
- llvmorg-18.1.4
- llvmorg-18.1.3
- llvmorg-18.1.2
- llvmorg-18.1.1
- llvmorg-18.1.0
- llvmorg-18.1.0-rc4
- llvmorg-18.1.0-rc3
- llvmorg-18.1.0-rc2
- llvmorg-18.1.0-rc1
- llvmorg-18-init
- llvmorg-17.0.6
- llvmorg-17.0.5
- llvmorg-17.0.4
- llvmorg-17.0.3
- llvmorg-17.0.2
- llvmorg-17.0.1
- llvmorg-17.0.0
- llvmorg-17.0.0-rc4
- llvmorg-17.0.0-rc3
- llvmorg-17.0.0-rc2
- llvmorg-17.0.0-rc1
- llvmorg-17-init
- llvmorg-16.0.6
- llvmorg-16.0.5
- llvmorg-16.0.4
- llvmorg-16.0.3
- llvmorg-16.0.2
- llvmorg-16.0.1
- llvmorg-16.0.0
- llvmorg-16.0.0-rc4
- llvmorg-16.0.0-rc3
- llvmorg-16.0.0-rc2
- llvmorg-16.0.0-rc1
- llvmorg-16-init
- llvmorg-15.0.7
- llvmorg-15.0.6
- llvmorg-15.0.5
- llvmorg-15.0.4
- llvmorg-15.0.3
- llvmorg-15.0.2
- llvmorg-15.0.1
- llvmorg-15.0.0
- llvmorg-15.0.0-rc3
- llvmorg-15.0.0-rc2
- llvmorg-15.0.0-rc1
- llvmorg-15-init
- llvmorg-14.0.6
- llvmorg-14.0.5
- llvmorg-14.0.4
- llvmorg-14.0.3
- llvmorg-14.0.2
- llvmorg-14.0.1
- llvmorg-14.0.0
- llvmorg-14.0.0-rc4
- llvmorg-14.0.0-rc3
- llvmorg-14.0.0-rc2
- llvmorg-14.0.0-rc1
- llvmorg-14-init
- llvmorg-13.0.1
- llvmorg-13.0.1-rc3
- llvmorg-13.0.1-rc2
- llvmorg-13.0.1-rc1
- llvmorg-13.0.0
- llvmorg-13.0.0-rc4
- llvmorg-13.0.0-rc3
- llvmorg-13.0.0-rc2
- llvmorg-13.0.0-rc1
- llvmorg-13-init
- llvmorg-12.0.1
- llvmorg-12.0.1-rc4
- llvmorg-12.0.1-rc3
- llvmorg-12.0.1-rc2
- llvmorg-12.0.1-rc1
- llvmorg-12.0.0
- llvmorg-12.0.0-rc5
- llvmorg-12.0.0-rc4
- llvmorg-12.0.0-rc3
- llvmorg-12.0.0-rc2
- llvmorg-12.0.0-rc1
- llvmorg-12-init
- llvmorg-11.1.0
- llvmorg-11.1.0-rc3
- llvmorg-11.1.0-rc2
- llvmorg-11.1.0-rc1
- llvmorg-11.0.1
- llvmorg-11.0.1-rc2
- llvmorg-11.0.1-rc1
- llvmorg-11.0.0
- llvmorg-11.0.0-rc6
- llvmorg-11.0.0-rc5
- llvmorg-11.0.0-rc4
- llvmorg-11.0.0-rc3
- llvmorg-11.0.0-rc2
- llvmorg-11.0.0-rc1
- llvmorg-11-init
- llvmorg-10.0.1
- llvmorg-10.0.1-rc4
- llvmorg-10.0.1-rc3
- llvmorg-10.0.1-rc2
- llvmorg-10.0.1-rc1
- llvmorg-10.0.0
- llvmorg-10.0.0-rc6
- llvmorg-10.0.0-rc5
- llvmorg-10.0.0-rc4
- llvmorg-10.0.0-rc3
- llvmorg-10.0.0-rc2
- llvmorg-10.0.0-rc1
- llvmorg-10-init
- llvmorg-9.0.1
- llvmorg-9.0.1-rc3
- llvmorg-9.0.1-rc2
- llvmorg-9.0.1-rc1
- llvmorg-9.0.0
- llvmorg-9.0.0-rc6
- llvmorg-9.0.0-rc5
- llvmorg-9.0.0-rc4
- llvmorg-9.0.0-rc3
- llvmorg-9.0.0-rc2
- llvmorg-9.0.0-rc1
- llvmorg-8.0.1
- llvmorg-8.0.1-rc4
- llvmorg-8.0.1-rc3
- llvmorg-8.0.1-rc2
- llvmorg-8.0.1-rc1
- llvmorg-8.0.0
- llvmorg-8.0.0-rc5
- llvmorg-8.0.0-rc4
- llvmorg-8.0.0-rc3
- llvmorg-8.0.0-rc2
- llvmorg-8.0.0-rc1
- llvmorg-7.1.0
- llvmorg-7.1.0-rc1
- llvmorg-7.0.1
- llvmorg-7.0.1-rc3
- llvmorg-7.0.1-rc2
- llvmorg-7.0.1-rc1
- llvmorg-7.0.0
- llvmorg-7.0.0-rc3
- llvmorg-7.0.0-rc2
- llvmorg-7.0.0-rc1
- llvmorg-6.0.1
- llvmorg-6.0.1-rc3
- llvmorg-6.0.1-rc2
- llvmorg-6.0.1-rc1
- llvmorg-6.0.0
- llvmorg-6.0.0-rc3
- llvmorg-6.0.0-rc2
- llvmorg-6.0.0-rc1
- llvmorg-5.0.2
- llvmorg-5.0.2-rc2
- llvmorg-5.0.2-rc1
- llvmorg-5.0.1
- llvmorg-5.0.1-rc3
- llvmorg-5.0.1-rc2
- llvmorg-5.0.1-rc1
- llvmorg-5.0.0
- llvmorg-5.0.0-rc5
- llvmorg-5.0.0-rc4
- llvmorg-5.0.0-rc3
- llvmorg-5.0.0-rc2
- llvmorg-5.0.0-rc1
- llvmorg-4.0.1
- llvmorg-4.0.1-rc3
- llvmorg-4.0.1-rc2
- llvmorg-4.0.1-rc1
- llvmorg-4.0.0
- llvmorg-4.0.0-rc4
- llvmorg-4.0.0-rc3
- llvmorg-4.0.0-rc2
- llvmorg-4.0.0-rc1
- llvmorg-3.9.1
- llvmorg-3.9.1-rc3
- llvmorg-3.9.1-rc2
- llvmorg-3.9.1-rc1
- llvmorg-3.9.0
- llvmorg-3.9.0-rc3
- llvmorg-3.9.0-rc2
- llvmorg-3.9.0-rc1
- llvmorg-3.8.1
- llvmorg-3.8.1-rc1
- llvmorg-3.8.0
- llvmorg-3.8.0-rc3
- llvmorg-3.8.0-rc2
- llvmorg-3.8.0-rc1
- llvmorg-3.7.1
- llvmorg-3.7.1-rc2
- llvmorg-3.7.1-rc1
- llvmorg-3.7.0
- llvmorg-3.7.0-rc4
- llvmorg-3.7.0-rc3
- llvmorg-3.7.0-rc2
- llvmorg-3.7.0-rc1
Leny Kholodov
committed
Apr 3, 2015
1 parent
8dba5da
commit 95ed78b
Showing
7 changed files
with
166 additions
and
0 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
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
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,116 @@ | ||
# Check handling of R_ARM_TARGET1 relocation. | ||
# | ||
# 1. R_ARM_TARGET1 is equal to R_ARM_ABS32 | ||
# RUN: yaml2obj -format=elf -docnum 1 %s > %t-abs32.o | ||
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \ | ||
# RUN: --noinhibit-exec --arm-target1-abs %t-abs32.o -o %t-abs32 | ||
# RUN: llvm-objdump -s -t %t-abs32 | FileCheck -check-prefix=CHECK-ABS32 %s | ||
# | ||
# CHECK-ABS32: Contents of section .data: | ||
# CHECK-ABS32-NEXT: 401000 84004000 | ||
# CHECK-ABS32: SYMBOL TABLE: | ||
# CHECK-ABS32: 00400074 g F .text {{[0-9a-f]+}} main | ||
# CHECK-ABS32: 00401000 g .data 00000004 data | ||
# | ||
# 2. R_ARM_TARGET1 is equal to R_ARM_REL32 | ||
# Check handling of R_ARM_REL32 relocation. | ||
# RUN: yaml2obj -format=elf %s -docnum 2 > %t-rel32.o | ||
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \ | ||
# RUN: --noinhibit-exec --arm-target1-rel %t-rel32.o -o %t-rel32 | ||
# RUN: llvm-objdump -s -t %t-rel32 | FileCheck -check-prefix=CHECK-REL32 %s | ||
# | ||
# CHECK-REL32: Contents of section .text: | ||
# CHECK-REL32-NEXT: 400074 {{[0-9a-f]+}} 880fff00 | ||
# CHECK-REL32: SYMBOL TABLE: | ||
# CHECK-REL32: 00400074 g F .text {{[0-9a-f]+}} main | ||
# CHECK-REL32: 00401000 g .bss {{[0-9a-f]+}} _myref | ||
|
||
# abs32.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: 04B02DE500B08DE20030A0E30300A0E100D04BE204B09DE41EFF2FE1 | ||
- Name: .data | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000004 | ||
Content: '10000000' | ||
- Name: .rel.data | ||
Type: SHT_REL | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000004 | ||
Info: .data | ||
Relocations: | ||
- Offset: 0x0000000000000000 | ||
Symbol: main | ||
Type: R_ARM_TARGET1 | ||
Addend: 0 | ||
- Name: .bss | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_WRITE, SHF_ALLOC ] | ||
AddressAlign: 0x0000000000000001 | ||
Content: '' | ||
Symbols: | ||
Global: | ||
- Name: main | ||
Type: STT_FUNC | ||
Section: .text | ||
Size: 0x000000000000001C | ||
- Name: data | ||
Type: STT_OBJECT | ||
Section: .data | ||
Size: 0x0000000000000004 | ||
# rel32.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: 80B400AF0000FF0000231846BD465DF8047B7047 | ||
- Name: .rel.text | ||
Type: SHT_REL | ||
Link: .symtab | ||
AddressAlign: 0x0000000000000004 | ||
Info: .text | ||
Relocations: | ||
- Offset: 0x0000000000000004 | ||
Symbol: _myref | ||
Type: R_ARM_TARGET1 | ||
- 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: '' | ||
Symbols: | ||
Global: | ||
- Name: _myref | ||
Type: STT_OBJECT | ||
Section: .bss | ||
Size: 0x0000000000000004 | ||
- Name: main | ||
Type: STT_FUNC | ||
Section: .text | ||
Value: 0x0000000000000001 | ||
Size: 0x0000000000000014 | ||
... |
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,5 @@ | ||
# Test of target specific options | ||
# RUN: lld -flavor gnu -target x86_64 --arm-target1-rel \ | ||
# RUN: %p/../Inputs/foo.o.x86-64 --noinhibit-exec -o %t 2>&1 | FileCheck %s | ||
|
||
# CHECK: warning: ignoring unsupported ARM/ELF specific argument: --arm-target1-rel |