Use stdout when printing object file names for -t option.
gold/ PR gold/27615 * errors.cc (Errors::trace): New method. (gold_trace): New function. * errors.h (Errors::trace): New method. * gold.h (gold_trace): New function. * object.cc (Input_objects::add_object): Use gold_trace to print object file names.
This commit is contained in:
parent
b218a83935
commit
35891b4775
@ -1,3 +1,13 @@
|
|||||||
|
2021-03-19 Cary Coutant <ccoutant@gmail.com>
|
||||||
|
|
||||||
|
PR gold/27615
|
||||||
|
* errors.cc (Errors::trace): New method.
|
||||||
|
(gold_trace): New function.
|
||||||
|
* errors.h (Errors::trace): New method.
|
||||||
|
* gold.h (gold_trace): New function.
|
||||||
|
* object.cc (Input_objects::add_object): Use gold_trace to print
|
||||||
|
object file names.
|
||||||
|
|
||||||
2021-03-19 Cary Coutant <ccoutant@gmail.com>
|
2021-03-19 Cary Coutant <ccoutant@gmail.com>
|
||||||
|
|
||||||
PR gold/pr23870
|
PR gold/pr23870
|
||||||
|
@ -128,6 +128,15 @@ Errors::info(const char* format, va_list args)
|
|||||||
fputc('\n', stderr);
|
fputc('\n', stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print a trace message.
|
||||||
|
|
||||||
|
void
|
||||||
|
Errors::trace(const char* format, va_list args)
|
||||||
|
{
|
||||||
|
vfprintf(stdout, format, args);
|
||||||
|
fputc('\n', stdout);
|
||||||
|
}
|
||||||
|
|
||||||
// Report an error at a reloc location.
|
// Report an error at a reloc location.
|
||||||
|
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
@ -275,6 +284,17 @@ gold_info(const char* format, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print a trace message (to stdout).
|
||||||
|
|
||||||
|
void
|
||||||
|
gold_trace(const char* format, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
parameters->errors()->trace(format, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
// Report an error at a location.
|
// Report an error at a location.
|
||||||
|
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
|
@ -68,6 +68,10 @@ class Errors
|
|||||||
void
|
void
|
||||||
info(const char* format, va_list);
|
info(const char* format, va_list);
|
||||||
|
|
||||||
|
// Print a trace message and continue.
|
||||||
|
void
|
||||||
|
trace(const char* format, va_list);
|
||||||
|
|
||||||
// Report an error at a reloc location.
|
// Report an error at a reloc location.
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
void
|
void
|
||||||
|
@ -99,6 +99,10 @@ gold_warning(const char* msg, ...) ATTRIBUTE_PRINTF_1;
|
|||||||
extern void
|
extern void
|
||||||
gold_info(const char* msg, ...) ATTRIBUTE_PRINTF_1;
|
gold_info(const char* msg, ...) ATTRIBUTE_PRINTF_1;
|
||||||
|
|
||||||
|
// This function is called to print a trace message.
|
||||||
|
extern void
|
||||||
|
gold_trace(const char* msg, ...) ATTRIBUTE_PRINTF_1;
|
||||||
|
|
||||||
// This function is called to emit an error message and then
|
// This function is called to emit an error message and then
|
||||||
// immediately exit with fallback status (e.g., when
|
// immediately exit with fallback status (e.g., when
|
||||||
// --incremental-update fails and the link needs to be restarted
|
// --incremental-update fails and the link needs to be restarted
|
||||||
|
@ -3199,7 +3199,7 @@ Input_objects::add_object(Object* obj)
|
|||||||
{
|
{
|
||||||
// Print the filename if the -t/--trace option is selected.
|
// Print the filename if the -t/--trace option is selected.
|
||||||
if (parameters->options().trace())
|
if (parameters->options().trace())
|
||||||
gold_info("%s", obj->name().c_str());
|
gold_trace("%s", obj->name().c_str());
|
||||||
|
|
||||||
if (!obj->is_dynamic())
|
if (!obj->is_dynamic())
|
||||||
this->relobj_list_.push_back(static_cast<Relobj*>(obj));
|
this->relobj_list_.push_back(static_cast<Relobj*>(obj));
|
||||||
|
Loading…
Reference in New Issue
Block a user