# Check that LLD shows an error if ADDIUPC immediate is out of range. # RUN: yaml2obj -format=elf %s > %t.o # RUN: not lld -flavor old-gnu -target mipsel -o %t.exe %t.o 2>&1 | FileCheck %s # CHECK: Relocation out of range in file {{.*}}: reference from __start+4 to T0+4 of type 173 (R_MICROMIPS_PC23_S2) FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS] Sections: - Name: .text Type: SHT_PROGBITS Content: "0000000080780100" # ^ PC23: 1 << 2 = 4 => T0 + 4 - 4 = T0 AddressAlign: 16 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] - Name: .data Type: SHT_PROGBITS Flags: [ SHF_ALLOC ] AddressAlign: 0x04 Size: 0x4000000 - Name: .rel.text Type: SHT_REL Info: .text AddressAlign: 4 Relocations: - Offset: 4 Symbol: T0 Type: R_MICROMIPS_PC23_S2 Symbols: Global: - Name: __start Section: .text Type: STT_FUNC Size: 8 Other: [ STO_MIPS_MICROMIPS ] - Name: TZ Section: .data Type: STT_FUNC Value: 0 Size: 0x2000000 - Name: T0 Section: .data Type: STT_FUNC Value: 0x2000000 Size: 4