aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-10-25 15:32:52 +1030
committerAlan Modra <amodra@gmail.com>2017-10-25 15:32:52 +1030
commite601d38b7cc222345d4128f45db18529b9fb477b (patch)
tree79f1755871c5362ca049b2123b7038f2d6787b8f /bfd
parent94092126a05ee625bf05d48cb331472b8f87d235 (diff)
downloadgdb-e601d38b7cc222345d4128f45db18529b9fb477b.zip
gdb-e601d38b7cc222345d4128f45db18529b9fb477b.tar.gz
gdb-e601d38b7cc222345d4128f45db18529b9fb477b.tar.bz2
Allow for __gnu_lto_slim prefixed with extra "_"
Some targets prefix global symbols with "_". bfd/ * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim" optionally prefixed with "_". * linker.c (_bfd_generic_link_add_one_symbol): Likewise. binutils/ * nm.c (filter_symbols): Match "__gnu_lto_slim" optionally prefixed with "_". gold/ * symtab.cc (Symbol_table::add_from_relobj): Match "__gnu_lto_slim" optionally prefixed with "_". ld/ * testsuite/ld-plugin/lto-3r.d: Match "__gnu_lto_v" optionally prefixed with "_". * testsuite/ld-plugin/lto-5r.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/archive.c6
-rw-r--r--bfd/linker.c4
3 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6f2f5e3..ca780aa 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-25 Alan Modra <amodra@gmail.com>
+
+ * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
+ optionally prefixed with "_".
+ * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
+
2017-10-24 Andrew Waterman <andrew@sifive.com>
* elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
diff --git a/bfd/archive.c b/bfd/archive.c
index 1e87685..0b98df3 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -2411,7 +2411,11 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
map = new_map;
}
- if (strcmp (syms[src_count]->name, "__gnu_lto_slim") == 0)
+ if (syms[src_count]->name[0] == '_'
+ && syms[src_count]->name[1] == '_'
+ && strcmp (syms[src_count]->name
+ + (syms[src_count]->name[2] == '_'),
+ "__gnu_lto_slim") == 0)
_bfd_error_handler
(_("%B: plugin needed to handle lto object"),
current);
diff --git a/bfd/linker.c b/bfd/linker.c
index 72d5705..a96c6ed 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -1403,7 +1403,9 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
{
row = COMMON_ROW;
if (!bfd_link_relocatable (info)
- && strcmp (name, "__gnu_lto_slim") == 0)
+ && name[0] == '_'
+ && name[1] == '_'
+ && strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0)
_bfd_error_handler
(_("%B: plugin needed to handle lto object"), abfd);
}