hanchenye-llvm-project/lld/test/elf/ARM/rel-tls-le32.test

74 lines
2.4 KiB
Plaintext

# Check handling of R_ARM_TLS_LE32 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 -check-prefix=STATIC %s
# STATIC: Contents of section .text:
# STATIC: 4000b4 {{[0-9a-f]+}} 08000000
# tp_off = 0x000008 ^^
# STATIC: SYMBOL TABLE:
# STATIC: 00400094 g F .text {{[0-9a-f]+}} main
# STATIC: 00000000 g .tdata 00000004 i
# RUN: yaml2obj -format=elf %s > %t-o.o
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi \
# RUN: --noinhibit-exec %t-o.o -o %t
# RUN: llvm-objdump -s -t %t | FileCheck -check-prefix=EXEC-DYN %s
# EXEC-DYN: Contents of section .text:
# EXEC-DYN: 400154 {{[0-9a-f]+}} 08000000
# tp_off = 0x000008 ^^
# EXEC-DYN: SYMBOL TABLE:
# EXEC-DYN: 00400134 g F .text {{[0-9a-f]+}} main
# EXEC-DYN: 00000000 g .tdata 00000004 i
---
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: 04B02DE500B08DE2703F1DEE10209FE5023093E70300A0E100D04BE204B09DE41EFF2FE100000000
- Name: .rel.text
Type: SHT_REL
Link: .symtab
AddressAlign: 0x0000000000000004
Info: .text
Relocations:
- Offset: 0x0000000000000024
Symbol: i
Type: R_ARM_TLS_LE32
Addend: 0
- 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
- Name: .tdata
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ]
AddressAlign: 0x0000000000000004
Content: '05000000'
Symbols:
Global:
- Name: i
Type: STT_TLS
Section: .tdata
Size: 0x0000000000000004
- Name: main
Type: STT_FUNC
Section: .text
...