# Check that the linker shows errors if ELF header flags # and .MIPS.abiflags section are incompatible. # RUN: yaml2obj -format=elf -docnum 1 %s > %t-isa.o # RUN: yaml2obj -format=elf -docnum 2 %s > %t-ext.o # RUN: yaml2obj -format=elf -docnum 3 %s > %t-ases.o # RUN: lld -flavor old-gnu -target mipsel -shared -o %t1.so %t-isa.o 2>&1 \ # RUN: | FileCheck -check-prefix=ISA-ERR %s # RUN: lld -flavor old-gnu -target mipsel -shared -o %t2.so %t-ext.o 2>&1 \ # RUN: | FileCheck -check-prefix=EXT-ERR %s # RUN: lld -flavor old-gnu -target mipsel -shared -o %t3.so %t-ases.o 2>&1 \ # RUN: | FileCheck -check-prefix=ASE-ERR %s # RUN: llvm-readobj -mips-abi-flags %t1.so %t2.so %t3.so \ # RUN: | FileCheck -check-prefix=SEC %s # ISA-ERR: inconsistent ISA between .MIPS.abiflags and ELF header e_flags field # EXT-ERR: inconsistent ISA between .MIPS.abiflags and ELF header e_flags field # ASE-ERR: inconsistent ASEs between .MIPS.abiflags and ELF header e_flags field # SEC: There is no .MIPS.abiflags section in the file. # isa.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 2 # ext.o --- FileHeader: Class: ELFCLASS32 Data: ELFDATA2LSB Type: ET_REL Machine: EM_MIPS Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_3, EF_MIPS_MACH_4650] Sections: - Name: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS3 ISAExtension: EXT_4120 # ases.o --- 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: .MIPS.abiflags Type: SHT_MIPS_ABIFLAGS AddressAlign: 8 ISA: MIPS32 ISARevision: 2 ASEs: [] ...