1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

.o file writing shouldn't mess around with pic/relo models like the JIT does.

llvm-svn: 75096
This commit is contained in:
Chris Lattner 2009-07-09 03:40:30 +00:00
parent ee29d5d753
commit c21f898300

View File

@ -305,24 +305,6 @@ bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM,
CodeGenOpt::Level OptLevel,
bool DumpAsm,
ObjectCodeEmitter &OCE) {
// FIXME: Move this to TargetJITInfo!
// On Darwin, do not override 64-bit setting made in X86TargetMachine().
if (DefRelocModel == Reloc::Default &&
(!Subtarget.isTargetDarwin() || !Subtarget.is64Bit())) {
setRelocationModel(Reloc::Static);
Subtarget.setPICStyle(PICStyles::None);
}
// 64-bit JIT places everything in the same buffer except external functions.
// On Darwin, use small code model but hack the call instruction for
// externals. Elsewhere, do not assume globals are in the lower 4G.
if (Subtarget.is64Bit()) {
if (Subtarget.isTargetDarwin())
setCodeModel(CodeModel::Small);
else
setCodeModel(CodeModel::Large);
}
PM.add(createX86ObjectCodeEmitterPass(*this, OCE));
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");