hanchenye-llvm-project/lld/test/elf/Mips/dynlib-dynamic.test

113 lines
3.7 KiB
Plaintext

# Check MIPS specific tags in the dynamic table.
# Build shared library
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t.so %t.o
# RUN: llvm-readobj -dynamic-table %t.so | FileCheck %s
# CHECK: Format: ELF32-mips
# CHECK: Arch: mipsel
# CHECK: AddressSize: 32bit
# CHECK: LoadName:
# CHECK: DynamicSection [ (15 entries)
# CHECK: Tag Type Name/Value
# CHECK-NEXT: 0x00000004 HASH 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x00000005 STRTAB 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x00000006 SYMTAB 0x{{[0-9A-F]+}}
# CHECK-NEXT: 0x0000000A STRSZ 17 (bytes)
# CHECK-NEXT: 0x0000000B SYMENT 16 (bytes)
# CHECK-NEXT: 0x0000001A FINI_ARRAY 0x0
# CHECK-NEXT: 0x0000001C FINI_ARRAYSZ 0 (bytes)
# CHECK-NEXT: 0x70000001 MIPS_RLD_VERSION 1
# CHECK-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
# CHECK-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x0
# CHECK-NEXT: 0x7000000A MIPS_LOCAL_GOTNO 4
# CHECK-NEXT: 0x70000011 MIPS_SYMTABNO 4
# CHECK-NEXT: 0x70000013 MIPS_GOTSYM 0x2
# CHECK-NEXT: 0x00000003 PLTGOT 0x1000
# CHECK-NEXT: 0x00000000 NULL 0x0
# CHECK-NEXT: ]
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [ EF_MIPS_PIC, EF_MIPS_CPIC,
EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x04
Size: 0x18
- Name: .rel.text
Type: SHT_REL
Link: .symtab
AddressAlign: 0x04
Info: .text
Relocations:
- Offset: 0x00
Symbol: '$.str1'
Type: R_MIPS_GOT16
- Offset: 0x04
Symbol: '$.str1'
Type: R_MIPS_LO16
- Offset: 0x08
Symbol: '$.str2'
Type: R_MIPS_GOT16
- Offset: 0x0C
Symbol: '$.str2'
Type: R_MIPS_LO16
- Offset: 0x10
Symbol: glob2
Type: R_MIPS_CALL16
- Offset: 0x14
Symbol: ext1
Type: R_MIPS_CALL16
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x04
Size: 0x00
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x04
Size: 0x00
- Name: .rodata.str1
Type: SHT_PROGBITS
AddressAlign: 0x01
Size: 0x05
- Name: .rodata.str2
Type: SHT_PROGBITS
AddressAlign: 0x01
Size: 0x05
Symbols:
Local:
- Name: '$.str1'
Section: .rodata.str1
- Name: '$.str2'
Section: .rodata.str2
- Name: .text
Type: STT_SECTION
Section: .text
- Name: .data
Type: STT_SECTION
Section: .data
- Name: .bss
Type: STT_SECTION
Section: .bss
- Name: .rodata.str1
Type: STT_SECTION
Section: .rodata.str1
- Name: .rodata.str2
Type: STT_SECTION
Section: .rodata.str2
Global:
- Name: glob
Section: .text
- Name: ext1
- Name: glob2