forked from Imagelibrary/binutils-gdb
From Craig Silverstein: accept any string for input format, warn if
thread options when not supported.
This commit is contained in:
@@ -341,7 +341,7 @@ string_to_object_format(const char* arg)
|
|||||||
return gold::General_options::OBJECT_FORMAT_BINARY;
|
return gold::General_options::OBJECT_FORMAT_BINARY;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gold::gold_error(_("format '%s' not supported "
|
gold::gold_error(_("format '%s' not supported; treating as elf "
|
||||||
"(supported formats: elf, binary)"),
|
"(supported formats: elf, binary)"),
|
||||||
arg);
|
arg);
|
||||||
return gold::General_options::OBJECT_FORMAT_ELF;
|
return gold::General_options::OBJECT_FORMAT_ELF;
|
||||||
@@ -628,6 +628,22 @@ General_options::finalize()
|
|||||||
if (this->thread_count() > 0 && this->thread_count_final() == 0)
|
if (this->thread_count() > 0 && this->thread_count_final() == 0)
|
||||||
this->set_thread_count_final(this->thread_count());
|
this->set_thread_count_final(this->thread_count());
|
||||||
|
|
||||||
|
// Let's warn if you set the thread-count but we're going to ignore it.
|
||||||
|
#ifndef ENABLE_THREADS
|
||||||
|
if (this->threads())
|
||||||
|
{
|
||||||
|
gold_warning(_("ignoring --threads: "
|
||||||
|
"%s was compiled without thread support"),
|
||||||
|
program_name);
|
||||||
|
this->set_threads(false);
|
||||||
|
}
|
||||||
|
if (this->thread_count() > 0 || this->thread_count_initial() > 0
|
||||||
|
|| this->thread_count_middle() > 0 || this->thread_count_final() > 0)
|
||||||
|
gold_warning(_("ignoring --thread-count: "
|
||||||
|
"%s was compiled without thread support"),
|
||||||
|
program_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Even if they don't specify it, we add -L /lib and -L /usr/lib.
|
// Even if they don't specify it, we add -L /lib and -L /usr/lib.
|
||||||
// FIXME: We should only do this when configured in native mode.
|
// FIXME: We should only do this when configured in native mode.
|
||||||
this->add_to_library_path_with_sysroot("/lib");
|
this->add_to_library_path_with_sysroot("/lib");
|
||||||
|
|||||||
@@ -415,11 +415,12 @@ class General_options
|
|||||||
DEFINE_bool(Bsymbolic, options::ONE_DASH, '\0', false,
|
DEFINE_bool(Bsymbolic, options::ONE_DASH, '\0', false,
|
||||||
_("Bind defined symbols locally"), NULL);
|
_("Bind defined symbols locally"), NULL);
|
||||||
|
|
||||||
DEFINE_enum(format, options::TWO_DASHES, 'b', "elf",
|
// This should really be an "enum", but it's too easy for folks to
|
||||||
_("Set input format"), _("[elf,binary]"),
|
// forget to update the list as they add new targets. So we just
|
||||||
{"elf", "binary",
|
// accept any string. We'll fail later (when the string is parsed),
|
||||||
"elf32-i386", "elf32-little", "elf32-big",
|
// if the target isn't actually supported.
|
||||||
"elf64-x86_64", "elf64-little", "elf64-big"});
|
DEFINE_string(format, options::TWO_DASHES, 'b', "elf",
|
||||||
|
_("Set input format"), _("[elf,binary]"));
|
||||||
|
|
||||||
#ifdef HAVE_ZLIB_H
|
#ifdef HAVE_ZLIB_H
|
||||||
DEFINE_enum(compress_debug_sections, options::TWO_DASHES, '\0', "none",
|
DEFINE_enum(compress_debug_sections, options::TWO_DASHES, '\0', "none",
|
||||||
|
|||||||
Reference in New Issue
Block a user