llvm-project/lld/test/elf/Mips/rel-dynamic-06-64.test

115 lines
2.7 KiB
Plaintext

# Conditions:
# a) Linking a shared library.
# b) The first relocation modifies a regular .text section.
# c) The second relocation modifies a .pdr section without SHF_ALLOC flag.
# Check:
# a) There should be no PLT entries.
# b) Linker creates a single R_MIPS_REL32 relocation.
#
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mips64el -shared -o %t.so %t.o
# RUN: llvm-readobj -dt -r -s %t.so | FileCheck -check-prefix=SYM %s
# RUN: llvm-readobj -mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
# SYM: Sections [
# SYM: Section {
# SYM-NOT: Name: .plt ({{[0-9]+}})
# SYM: Relocations [
# SYM-NEXT: Section (4) .rel.dyn {
# SYM-NEXT: 0x[[ADDR:[0-9A-Z]+]] R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE T0 0x0
# SYM-NEXT: }
# SYM-NEXT: ]
# SYM: Symbol {
# SYM: Name: @ (0)
# SYM-NEXT: Value: 0x0
# SYM-NEXT: Size: 0
# SYM-NEXT: Binding: Local (0x0)
# SYM-NEXT: Type: None (0x0)
# SYM-NEXT: Other: 0
# SYM-NEXT: Section: Undefined (0x0)
# SYM-NEXT: }
# SYM: Symbol {
# SYM: Name: T1@ (4)
# SYM-NEXT: Value: 0x174
# SYM-NEXT: Size: 4
# SYM-NEXT: Binding: Global (0x1)
# SYM-NEXT: Type: Function (0x2)
# SYM-NEXT: Other: 0
# SYM-NEXT: Section: .text (0x5)
# SYM-NEXT: }
# SYM: Symbol {
# SYM: Name: T0@ (1)
# SYM-NEXT: Value: 0x[[ADDR]]
# SYM-NEXT: Size: 4
# SYM-NEXT: Binding: Global (0x1)
# SYM-NEXT: Type: Function (0x2)
# SYM-NEXT: Other: 0
# SYM-NEXT: Section: .text (0x5)
# SYM-NEXT: }
# GOT: Local entries [
# GOT-NEXT: ]
# GOT-NEXT: Global entries [
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x1010
# GOT-NEXT: Access: -32736
# GOT-NEXT: Initial: 0x170
# GOT-NEXT: Value: 0x170
# GOT-NEXT: Type: Function (0x2)
# GOT-NEXT: Section: .text (0x5)
# GOT-NEXT: Name: T0@ (1)
# GOT-NEXT: }
# GOT-NEXT: ]
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: 8
AddressAlign: 16
Flags: [SHF_EXECINSTR, SHF_ALLOC]
- Name: .rel.text
Type: SHT_RELA
Info: .text
AddressAlign: 4
Relocations:
- Offset: 0
Symbol: T0
Type: R_MIPS_64
- Name: .pdr
Type: SHT_PROGBITS
Size: 8
AddressAlign: 16
- Name: .rel.pdr
Type: SHT_RELA
Info: .pdr
AddressAlign: 4
Relocations:
- Offset: 0
Symbol: T1
Type: R_MIPS_64
Symbols:
Global:
- Name: T0
Section: .text
Type: STT_FUNC
Value: 0x0
Size: 4
- Name: T1
Section: .text
Type: STT_FUNC
Value: 4
Size: 4