llvm-project/lld/test/old-elf/ARM/rel-arm-prel31.test

91 lines
3.0 KiB
Plaintext

# Check handling of R_ARM_PREL31 relocation.
# RUN: yaml2obj -format=elf -docnum=1 %s > %t-o.o
# RUN: lld -flavor old-gnu -target arm -m armelf_linux_eabi -Bstatic \
# RUN: --noinhibit-exec --defsym=main=__gxx_personality_v0 %t-o.o -o %t
# RUN: llvm-objdump -s -t %t | FileCheck %s
# CHECK: Contents of section .ARM.extab:
# CHECK: 4000a4 b1fffe7f
# CHECK: SYMBOL TABLE:
# CHECK: 00400054 g F .text {{[0-9a-f]+}} __gxx_personality_v0
# RUN: yaml2obj -format=elf -docnum=2 %s > %t-o.o
# RUN: not lld -flavor old-gnu -target arm -m armelf_linux_eabi -Bstatic \
# RUN: --noinhibit-exec --defsym=main=__gxx_personality_v0 %t-o.o -o %t 2> %t-error
# RUN: FileCheck -check-prefix=OVERFLOW %s < %t-error
# OVERFLOW: Relocation out of range {{.*}} (R_ARM_PREL31)
# good.o
---
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: 0000FF7F84019701B0B0B008FFFF01080E2432003A040000
- 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
# overflow.o
---
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: 0000004084019701B0B0B008FFFF01080E2432003A040000
- 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
...