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)
commitf9f753c2eab279ef3943c84f8a31a38d4c01e595
tree9238c4ed135225a1628a13787a5197b42013fe23
parent8f181a5406d3bfdfd68e2c44e43e6ccf369f1359
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

llvm-svn: 184220
llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
llvm/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/test/MC/Mips/abicalls.ll [new file with mode: 0644]
llvm/test/MC/Mips/elf_eflags.ll