mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-03 12:18:00 +00:00
Teach llvm-lto to respect the given RelocModel.
Patch by Nick Tomlinson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -65,7 +65,7 @@ const char* LTOCodeGenerator::getVersionString() {
|
||||
LTOCodeGenerator::LTOCodeGenerator()
|
||||
: Context(getGlobalContext()), Linker(new Module("ld-temp.o", Context)),
|
||||
TargetMach(NULL), EmitDwarfDebugInfo(false), ScopeRestrictionsDone(false),
|
||||
CodeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC), NativeObjectFile(NULL),
|
||||
CodeModel(LTO_CODEGEN_PIC_MODEL_DEFAULT), NativeObjectFile(NULL),
|
||||
DiagHandler(NULL), DiagContext(NULL) {
|
||||
initializeLTOPasses();
|
||||
}
|
||||
@@ -161,6 +161,7 @@ void LTOCodeGenerator::setCodePICModel(lto_codegen_model model) {
|
||||
case LTO_CODEGEN_PIC_MODEL_STATIC:
|
||||
case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
|
||||
case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
|
||||
case LTO_CODEGEN_PIC_MODEL_DEFAULT:
|
||||
CodeModel = model;
|
||||
return;
|
||||
}
|
||||
@@ -295,6 +296,9 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
|
||||
case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
|
||||
RelocModel = Reloc::DynamicNoPIC;
|
||||
break;
|
||||
case LTO_CODEGEN_PIC_MODEL_DEFAULT:
|
||||
// RelocModel is already the default, so leave it that way.
|
||||
break;
|
||||
}
|
||||
|
||||
// construct LTOModule, hand over ownership of module and target
|
||||
|
Reference in New Issue
Block a user