Mips ELF: Mark object file as ABI compliant
authorJack Carter <jack.carter@imgtec.com>
Tue, 18 Jun 2013 19:47:15 +0000 (19:47 +0000)
committerJack Carter <jack.carter@imgtec.com>
Tue, 18 Jun 2013 19:47:15 +0000 (19:47 +0000)
commit571dd98ea4d6bf911c3b46a20ca3b5e3b341b21f
tree5c0444f6ad5d9fef26a170bf8d183012144c6f31
parent2e0f70bdd8814eefb752f1d0221800cbdbd8d1f5
Mips ELF: Mark object file as ABI compliant

When producing objects that are abi compliant we are
marking neither the object file nor the assembly file
correctly and thus generate warnings.

We need to set the EF_CPIC flag in the ELF header when
generating direct object.

Note that the warning is only generated when compiling without PIC.

When compiling with clang the warning will be suppressed by supplying:

 -Wa,-mno-shared -Wa,-call_nonpic

Also the following directive should also be added:

.option pic0

when compiling without PIC,  This eliminates the need for supplying:

  -mno-shared -call_nonpic

on the assembler command line.

Patch by Douglas Gilmore

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184220 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
test/MC/Mips/abicalls.ll [new file with mode: 0644]
test/MC/Mips/elf_eflags.ll