| # Check R_MICROMIPS_GPREL7_S2 relocation overflow handling. |
| # |
| # RUN: yaml2obj -format=elf %s > %t.o |
| # RUN: not lld -flavor old-gnu -target mipsel -shared -o %t.so %t.o 2>&1 \ |
| # RUN: | FileCheck %s |
| |
| # CHECK: Relocation out of range in file {{.*}} reference from +0 to L0+-4 of type 172 (R_MICROMIPS_GPREL7_S2) |
| |
| 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_32R2, EF_MIPS_MICROMIPS] |
| |
| Sections: |
| - Type: SHT_PROGBITS |
| Name: .text |
| Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| AddressAlign: 4 |
| Size: 4 |
| |
| - Type: SHT_PROGBITS |
| Name: .rodata |
| Flags: [ SHF_ALLOC ] |
| AddressAlign: 4 |
| Content: 7f000000 |
| |
| - Type: SHT_REL |
| Name: .rel.rodata |
| Link: .symtab |
| Info: .rodata |
| AddressAlign: 4 |
| Relocations: |
| - Offset: 0 |
| Symbol: L0 |
| Type: R_MICROMIPS_GPREL7_S2 |
| |
| Symbols: |
| Local: |
| - Name: L0 |
| Section: .text |
| Value: 0 |
| Size: 4 |
| - Name: .rodata |
| Type: STT_SECTION |
| Section: .rodata |