ELF/AArch64: Add a test for R_AARCH64_ABS32

llvm-svn: 224014
This commit is contained in:
Will Newton 2014-12-11 12:37:35 +00:00
parent e58c89b30f
commit 0b1db0a535
1 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,59 @@
# Check handling of R_AARCH64_ABS32 relocation.
# RUN: yaml2obj -format=elf %s > %t-obj
# RUN: lld -flavor gnu -target arm64 -o %t-exe %t-obj
# RUN: llvm-objdump -s -t %t-exe | FileCheck %s
# CHECK: Contents of section .data:
# CHECK-NEXT: 401060 65104080 61104080 e.@.a.@.
# ^^ data2 + 0x80000001 = 0x80401069
# ^^ data1 + 0x80000001 = 0x80401061
# CHECK: SYMBOL TABLE:
# CHECK: 00401060 g .data 00000004 data1
# CHECK: 00401064 g .data 00000004 data2
!ELF
FileHeader: !FileHeader
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_AARCH64
Sections:
- Name: .text
Type: SHT_PROGBITS
Content: "00000000"
AddressAlign: 16
Flags: [SHF_ALLOC, SHF_EXECINSTR]
- Name: .data
Type: SHT_PROGBITS
Content: "0000000000000000"
AddressAlign: 16
Flags: [SHF_ALLOC, SHF_WRITE]
- Name: .rela.data
Type: SHT_RELA
Info: .data
AddressAlign: 8
Relocations:
- Offset: 0x0
Symbol: data2
Type: R_AARCH64_ABS32
Addend: 0x80000001
- Offset: 0x4
Symbol: data1
Type: R_AARCH64_ABS32
Addend: 0x80000001
Symbols:
Global:
- Name: _start
Section: .text
Value: 0x0
Size: 4
- Name: data1
Section: .data
Size: 4
- Name: data2
Section: .data
Value: 0x4
Size: 4