# Check R_MIPS_EH relocation handling in case of -pcrel-eh-reloc option. # RUN: yaml2obj -format=elf -docnum 1 %s > %t1.o # RUN: yaml2obj -format=elf -docnum 2 %s > %t2.o # RUN: lld -flavor gnu -target mipsel -e T0 \ # RUN: -pcrel-eh-reloc -o %t.exe %t1.o %t2.o # RUN: llvm-objdump -s -t %t.exe | FileCheck -check-prefix=RAW %s # RAW: Contents of section .gnu_extab: # RAW-NEXT: 400148 00e7ffff ff000000 b01e0000 00000000 # ^ 0x400130 + 0 - 0x400149 = 0xffffffe7 # ^ 0x402000 + 0 - 0x400150 = 0x1eb0 # E1 GOT entry = 0xffff8020 = -32736 ^ # RAW: Contents of section .got: # RAW-NEXT: 401000 00000000 00000080 # RAW: SYMBOL TABLE: # RAW: 00402000 l .data 00000004 L1 # RAW: 00400130 g F .text 00000004 T1 # t1.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_NOREORDER, EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2] Sections: - Name: .text Type: SHT_PROGBITS Flags: [SHF_ALLOC, SHF_EXECINSTR] AddressAlign: 16 Size: 4 Symbols: Global: - Name: T1 Type: STT_FUNC Section: .text Value: 0 Size: 4 # t2.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_NOREORDER, EF_MIPS_CPIC, EF_MIPS_PIC, 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 Type: SHT_PROGBITS Flags: [SHF_WRITE, SHF_ALLOC] AddressAlign: 16 Size: 4 - Name: .gnu_extab Type: SHT_PROGBITS Flags: [SHF_ALLOC] AddressAlign: 4 Size: 16 - Name: .rel.gnu_extab Type: SHT_REL Link: .symtab AddressAlign: 4 Info: .gnu_extab Relocations: - Offset: 1 Symbol: T1 Type: R_MIPS_EH - Offset: 8 Symbol: L1 Type: R_MIPS_EH - Name: .eh_frame_entry Type: SHT_PROGBITS Flags: [SHF_ALLOC] AddressAlign: 4 Content: "0000000100000001" - Name: .rel.eh_frame_entry Type: SHT_REL Link: .symtab AddressAlign: 4 Info: .eh_frame_entry Relocations: - Offset: 0 Symbol: .text Type: R_MIPS_PC32 - Offset: 4 Symbol: .gnu_extab Type: R_MIPS_PC32 Symbols: Local: - Name: .text Type: STT_SECTION Section: .text - Name: .gnu_extab Type: STT_SECTION Section: .gnu_extab - Name: L1 Type: STT_OBJECT Section: .data Value: 0 Size: 4 Global: - Name: T0 Type: STT_FUNC Section: .text Value: 0 Size: 8 - Name: T1 ...