Index: tools/gold/gold-plugin.cpp =================================================================== --- tools/gold/gold-plugin.cpp +++ tools/gold/gold-plugin.cpp @@ -128,7 +128,8 @@ OT_NORMAL, OT_DISABLE, OT_BC_ONLY, - OT_SAVE_TEMPS + OT_SAVE_TEMPS, + OT_OBJ_FILES }; static OutputType TheOutputType = OT_NORMAL; static unsigned OptLevel = 2; @@ -227,6 +228,8 @@ TheOutputType = OT_BC_ONLY; } else if (opt == "save-temps") { TheOutputType = OT_SAVE_TEMPS; + } else if (opt == "obj-files") { + TheOutputType = OT_OBJ_FILES; } else if (opt == "disable-output") { TheOutputType = OT_DISABLE; } else if (opt == "thinlto") { @@ -863,6 +866,7 @@ switch (options::TheOutputType) { case options::OT_NORMAL: + case options::OT_OBJ_FILES: break; case options::OT_DISABLE: @@ -1009,7 +1013,8 @@ // Note that getOutputFileName will append a unique ID for each task if (!options::obj_path.empty()) Filename = options::obj_path; - else if (options::TheOutputType == options::OT_SAVE_TEMPS) + else if (options::TheOutputType == options::OT_SAVE_TEMPS || + options::TheOutputType == options::OT_OBJ_FILES) Filename = output_name + ".o"; bool SaveTemps = !Filename.empty();