# Check that the linker does not accept position-dependent relocations # in case of shared library linking. # RUN: yaml2obj -format=elf -docnum 1 %s > %t-hi.o # RUN: not lld -flavor old-gnu -target mipsel -shared -o %t.so %t-hi.o 2>&1 \ # RUN: | FileCheck -check-prefix=RHI %s # RHI: R_MIPS_HI16 (5) relocation cannot be used when making a shared object, recompile {{.*}}validate-rel-01.test.tmp-hi.o with -fPIC # RUN: yaml2obj -format=elf -docnum 2 %s > %t-26.o # RUN: not lld -flavor old-gnu -target mipsel -shared -o %t.so %t-26.o 2>&1 \ # RUN: | FileCheck -check-prefix=R26 %s # R26: R_MIPS_26 (4) relocation cannot be used when making a shared object, recompile {{.*}}validate-rel-01.test.tmp-26.o with -fPIC --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] AddressAlign: 16 Size: 4 - Name: .rel.text Type: SHT_REL Link: .symtab AddressAlign: 4 Info: .text Relocations: - Offset: 0 Symbol: T0 Type: R_MIPS_HI16 - Offset: 0 Symbol: T0 Type: R_MIPS_LO16 Symbols: Global: - Name: T0 Type: STT_FUNC Section: .text Size: 4 --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] AddressAlign: 16 Size: 4 - Name: .rel.text Type: SHT_REL Link: .symtab AddressAlign: 4 Info: .text Relocations: - Offset: 0 Symbol: T1 Type: R_MIPS_26 Symbols: Global: - Name: T1 Type: STT_FUNC Section: .text Size: 4 ...