llvm-project/lld/test/old-elf/Mips/sign-rela.test

55 lines
1.2 KiB
Plaintext

# Check that relocation addend read from RELA record is not sign-extended.
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor old-gnu -target mips64el -o %t.exe %t.o
# RUN: llvm-objdump -s %t.exe | FileCheck %s
# CHECK: {{[0-9a-f]+}} 01000000 00000000 ........
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 16
Size: 0x20008
- Name: .rel.text
Type: SHT_RELA
Link: .symtab
AddressAlign: 4
Info: .text
Relocations:
- Offset: 0x20000
Symbol: __start
Type: R_MIPS_PC16
Addend: 0x20000
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 16
Size: 0
Symbols:
Local:
- Name: T0
Type: STT_FUNC
Section: .text
Value: 0
Size: 4
Global:
- Name: __start
Type: STT_FUNC
Section: .text
Value: 4
Size: 0x20004
...