# Conditions: # a) Linking a shared library. # b) Relocations' targets are undefined symbols. # Check: # a) Emitting R_MIPS_REL32 relocations for both undefined symbols. # b) There should be no PLT entries. # # RUN: yaml2obj -format=elf %s > %t-obj # RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t1-so %t-obj # RUN: llvm-readobj -dt -r -s %t1-so | FileCheck -check-prefix=PLT-SYM %s # PLT-SYM: Sections [ # PLT-SYM: Section { # PLT-SYM-NOT: Name: .plt ({{[0-9]+}}) # # PLT-SYM: Relocations [ # PLT-SYM-NEXT: Section (4) .rel.dyn { # PLT-SYM-NEXT: 0x140 R_MIPS_REL32 T1 0x0 # PLT-SYM-NEXT: 0x2000 R_MIPS_REL32 T1 0x0 # PLT-SYM-NEXT: } # PLT-SYM-NEXT: ] # # PLT-SYM: Name: T1@ (7) # PLT-SYM-NEXT: Value: 0x0 # PLT-SYM-NEXT: Size: 0 # PLT-SYM-NEXT: Binding: Global (0x1) # PLT-SYM-NEXT: Type: None (0x0) # PLT-SYM-NEXT: Other: 0 # PLT-SYM-NEXT: Section: Undefined (0x0) !ELF FileHeader: !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 Content: "0000000000000000" AddressAlign: 16 Flags: [SHF_EXECINSTR, SHF_ALLOC] - Name: .data Type: SHT_PROGBITS Content: "0000000000000000" AddressAlign: 16 Flags: [SHF_WRITE, SHF_ALLOC] - Name: .rel.text Type: SHT_REL Info: .text AddressAlign: 4 Relocations: - Offset: 0x00 Symbol: T1 Type: R_MIPS_32 - Name: .rel.data Type: SHT_REL Info: .data AddressAlign: 4 Relocations: - Offset: 0x00 Symbol: T1 Type: R_MIPS_32 Symbols: Global: - Name: T0 Section: .text Type: STT_FUNC Value: 0x0 Size: 4 - Name: T1 - Name: D0 Section: .data Type: STT_OBJECT Value: 0x0 Size: 8