| # Check handling of R_MIPS_32 relocation in the big-endian case. |
| |
| # RUN: yaml2obj -format=elf %s > %t.o |
| # RUN: lld -flavor old-gnu -target mips -o %t.exe %t.o |
| # RUN: llvm-objdump -s -t %t.exe | FileCheck %s |
| |
| # CHECK: Contents of section .data: |
| # CHECK-NEXT: 402000 00000000 01402088 01402084 |
| # ^^ D2 + 0x1000080 = 0x1402088 |
| # ^^ D1 + 0x1000080 = 0x1402084 |
| # CHECK: SYMBOL TABLE: |
| # CHECK: 00402004 g .data 00000004 D1 |
| # CHECK: 00402008 g .data 00000004 D2 |
| |
| FileHeader: |
| Class: ELFCLASS32 |
| Data: ELFDATA2MSB |
| Type: ET_REL |
| Machine: EM_MIPS |
| Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] |
| |
| Sections: |
| - Name: .text |
| Type: SHT_PROGBITS |
| AddressAlign: 16 |
| Flags: [SHF_ALLOC] |
| Size: 4 |
| |
| - Name: .data |
| Type: SHT_PROGBITS |
| AddressAlign: 16 |
| Flags: [SHF_ALLOC, SHF_WRITE] |
| Content: "000000000100008001000080" |
| |
| - Name: .rel.data |
| Type: SHT_REL |
| Info: .data |
| AddressAlign: 4 |
| Relocations: |
| - Offset: 4 |
| Symbol: D2 |
| Type: R_MIPS_32 |
| - Offset: 8 |
| Symbol: D1 |
| Type: R_MIPS_32 |
| |
| Symbols: |
| Global: |
| - Name: __start |
| Section: .text |
| Value: 0 |
| Size: 4 |
| - Name: D1 |
| Section: .data |
| Value: 4 |
| Size: 4 |
| - Name: D2 |
| Section: .data |
| Value: 8 |
| Size: 4 |