# Check that LLD generates dynamic relocation R_MIPS_REL32 for local # symbols if the symbols referenced by R_MIPS_32 relocation. # RUN: yaml2obj -format=elf %s > %t.o # RUN: lld -flavor old-gnu -target mipsel -shared -o %t.so %t.o # RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=RAW %s # RUN: llvm-readobj -r %t.so | FileCheck -check-prefix=REL %s # RAW: Contents of section .text: # RAW-NEXT: 0120 00000000 00000000 # RAW: Contents of section .data.rel.local: # RAW-NEXT: 2000 20010000 00000000 # REL: Relocations [ # REL-NEXT: Section (4) .rel.dyn { # REL-NEXT: 0x2000 R_MIPS_REL32 - 0x0 # REL-NEXT: 0x2004 R_MIPS_REL32 T1 0x0 # REL-NEXT: } # REL-NEXT: ] --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2] Sections: - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] AddressAlign: 16 Size: 8 - Name: .data.rel.local Type: SHT_PROGBITS Flags: [ SHF_WRITE, SHF_ALLOC ] AddressAlign: 4 Size: 8 - Name: .rel.data.rel.local Type: SHT_REL Link: .symtab AddressAlign: 4 Info: .data.rel.local Relocations: - Offset: 0 Symbol: .text Type: R_MIPS_32 - Offset: 4 Symbol: T1 Type: R_MIPS_32 Symbols: Local: - Name: .text Type: STT_SECTION Section: .text - Name: T0 Type: STT_FUNC Section: .text Value: 0 Size: 4 - Name: .data.rel.local Type: STT_SECTION Section: .data.rel.local Global: - Name: D0 Type: STT_OBJECT Section: .data.rel.local Value: 0 Size: 8 - Name: T1 Type: STT_FUNC Section: .text Value: 4 Size: 4 ...