This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] Warn on lto objects without plugin
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Cary Coutant <ccoutant at google dot com>
- Date: Tue, 5 Aug 2014 12:12:04 +0930
- Subject: [GOLD] Warn on lto objects without plugin
- Authentication-results: sourceware.org; auth=none
A similar hack for gold to those I've added for BFD ld, ar, nm and
ranlib. The idea being to give users a clue, and cut down on the
number of invalid bugzillas. You'll get something like
hello.a(hello.o): plugin needed to handle lto object
.../crt1.o(.text+0x20): error: undefined reference to 'main'
rather than just
.../crt1.o(.text+0x20): error: undefined reference to 'main'
OK to apply?
PR 13227
* symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
diff --git a/gold/symtab.cc b/gold/symtab.cc
index b329bb6..210ab25 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1133,6 +1133,10 @@ Symbol_table::add_from_relobj(
const char* name = sym_names + st_name;
+ if (strcmp (name, "__gnu_lto_slim") == 0)
+ gold_info(_("%s: plugin needed to handle lto object"),
+ relobj->name().c_str());
+
bool is_ordinary;
unsigned int st_shndx = relobj->adjust_sym_shndx(i + symndx_offset,
sym.get_st_shndx(),
--
Alan Modra
Australia Development Lab, IBM