hanchenye-llvm-project/lld/test/old-elf/Mips/dt-textrel-64.test

75 lines
1.7 KiB
Plaintext

# Check that if a dynamic relocation R_MIPS_64 modify a read-only section,
# .dynamic section contains the DT_TEXTREL tag.
# RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o
# RUN: lld -flavor old-gnu -target mips64el -shared -o %t.so %t-so.o
# RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o
# RUN: lld -flavor old-gnu -target mips64el -e T0 -o %t.exe %t-o.o %t.so
# RUN: llvm-readobj -dynamic-table %t.exe | FileCheck %s
# CHECK: 0x{{[0-9A-F]+}} TEXTREL
# so.o
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
Sections:
- Name: .text
Type: SHT_PROGBITS
Size: 0x4
AddressAlign: 16
Flags: [SHF_EXECINSTR, SHF_ALLOC]
Symbols:
Global:
- Name: T1
Section: .text
Type: STT_FUNC
Value: 0x0
Size: 0x08
# o.o
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x4
Size: 0x8
- Name: .rel.text
Type: SHT_RELA
Link: .symtab
Info: .text
AddressAlign: 0x04
Relocations:
- Offset: 0
Symbol: T1
Type: R_MIPS_64
Symbols:
Local:
- Name: .text
Type: STT_SECTION
Section: .text
Global:
- Name: T0
Type: STT_FUNC
Section: .text
Size: 0x8
- Name: T1
...