Index: tools/gold/gold-plugin.cpp =================================================================== --- tools/gold/gold-plugin.cpp +++ tools/gold/gold-plugin.cpp @@ -80,6 +80,7 @@ static std::string extra_library_path; static std::string triple; static std::string mcpu; + static bool relocation_pic = false; // Additional options to pass into the code generator. // Note: This array will contain all plugin options which are not claimed // as plugin exclusive to pass to the code generator. @@ -101,6 +102,8 @@ extra_library_path = opt.substr(strlen("extra_library_path=")); } else if (opt.startswith("mtriple=")) { triple = opt.substr(strlen("mtriple=")); + } else if (opt == "relocation-pic") { + relocation_pic = true; } else if (opt.startswith("obj-path=")) { obj_path = opt.substr(strlen("obj-path=")); } else if (opt == "emit-llvm") { @@ -412,6 +415,8 @@ if (options::generate_api_file) api_file.close(); + if (options::relocation_pic) + output_type = LTO_CODEGEN_PIC_MODEL_DYNAMIC; lto_codegen_set_pic_model(code_gen, output_type); lto_codegen_set_debug_model(code_gen, LTO_DEBUG_MODEL_DWARF); if (!options::mcpu.empty())