llvm-project/lld/test/elf/ARM/rel-copy.test

61 lines
1.9 KiB
Plaintext

# Check handling of R_ARM_COPY relocation.
# RUN: yaml2obj -format=elf %s > %t-o.o
# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi \
# RUN: --noinhibit-exec %t-o.o -lobj -L%p/Inputs -o %t
# RUN: llvm-objdump -s -t %t | FileCheck %s
# RUN: llvm-readobj -relocations %t | FileCheck -check-prefix=READOBJ %s
# CHECK: Contents of section .rel.dyn:
# CHECK-NEXT: 400138 00104000 14010000
# addr = 0x401000 ^^ ^^ rel_type = 0x14 => R_ARM_COPY
# CHECK: SYMBOL TABLE:
# CHECK: 00401000 g .bss 00000004 object
#
# READOBJ: 0x401000 R_ARM_COPY object
---
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: 80B483B000AF40F20003C0F200031B687B60002318460C37BD465DF8047B7047
- Name: .rel.text
Type: SHT_REL
Link: .symtab
AddressAlign: 0x0000000000000004
Info: .text
Relocations:
- Offset: 0x0000000000000006
Symbol: object
Type: R_ARM_THM_MOVW_ABS_NC
- Offset: 0x000000000000000A
Symbol: object
Type: R_ARM_THM_MOVT_ABS
- 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
Symbols:
Local:
- Name: '$t'
Section: .text
Global:
- Name: main
Type: STT_FUNC
Section: .text
Value: 0x0000000000000001
- Name: object
...