]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Allow for __gnu_lto_slim prefixed with extra "_"
authorAlan Modra <amodra@gmail.com>
Wed, 25 Oct 2017 05:02:52 +0000 (15:32 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 1 Nov 2017 00:51:03 +0000 (11:21 +1030)
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.

(cherry picked from commit e601d38b7cc222345d4128f45db18529b9fb477b)

bfd/ChangeLog
bfd/archive.c
bfd/linker.c
binutils/ChangeLog
binutils/nm.c
gold/ChangeLog
gold/symtab.cc
ld/ChangeLog
ld/testsuite/ld-plugin/lto-3r.d
ld/testsuite/ld-plugin/lto-5r.d

index cd0a8f24d1118fed8c64a3e405659545c3d5e6c1..320e3f5ff75ad0c00928f73596b31398a60996aa 100644 (file)
@@ -1,3 +1,11 @@
+2017-11-01  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       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-05  Alan Modra  <amodra@gmail.com>
 
        * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
index 885bf489c024a7a24444bb82740987dd20aff184..af964ad19a3d89de9a0c9884879d078e08effbf0 100644 (file)
@@ -2405,7 +2405,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);
index 72d5705e639beb4af631099bd54ffb1b342323fb..a96c6ed1dd085080b76a70ff5ea5e13203ca2b61 100644 (file)
@@ -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);
     }
index ffb34fbb78e3ee8408d0571f815b833857d16ab3..6856b61e86a8c3e023b233b5190cd47695a8a167 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-01  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2017-10-25  Alan Modra  <amodra@gmail.com>
+       * nm.c (filter_symbols): Match "__gnu_lto_slim" optionally prefixed
+       with "_".
+
 2017-09-21  Maciej W. Rozycki  <macro@imgtec.com>
 
        * readelf.c (get_machine_flags) <E_MIPS_MACH_5900>: New case.
index 7ddcc8a113d20e90e39314ed5dc8eebf1514cdbd..2d8866ceda586a5410e528e7611f529e6638e0c4 100644 (file)
@@ -480,7 +480,9 @@ filter_symbols (bfd *abfd, bfd_boolean is_dynamic, void *minisyms,
       if (sym == NULL)
        bfd_fatal (bfd_get_filename (abfd));
 
-      if (strcmp (sym->name, "__gnu_lto_slim") == 0)
+      if (sym->name[0] == '_'
+         && sym->name[1] == '_'
+         && strcmp (sym->name + (sym->name[2] == '_'), "__gnu_lto_slim") == 0)
        non_fatal (_("%s: plugin needed to handle lto object"),
                   bfd_get_filename (abfd));
 
index 622a63a21428800f8cd77cc6ee08d44bb1303665..c8633e40b4f44ce80a018ebde30a014b4fe17829 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-01  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2017-10-25  Alan Modra  <amodra@gmail.com>
+       * symtab.cc (Symbol_table::add_from_relobj): Match "__gnu_lto_slim"
+       optionally prefixed with "_".
+
 2017-10-18  Kyle Butt  <iteratee@google.com>
            Alan Modra  <amodra@gmail.com>
 
index 7e0a3f80d2637dd987397970da3334484ef1e01e..1b4810ed533b196b4fcbc6c493362f81f8f56bd0 100644 (file)
@@ -1185,7 +1185,9 @@ Symbol_table::add_from_relobj(
       const char* name = sym_names + st_name;
 
       if (!parameters->options().relocatable()
-         && strcmp (name, "__gnu_lto_slim") == 0)
+         && name[0] == '_'
+         && name[1] == '_'
+         && strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0)
         gold_info(_("%s: plugin needed to handle lto object"),
                  relobj->name().c_str());
 
index ba67e20bf90d8b4de96ff39f0b7d69e51402b9a9..364b1040ec6febd0dba37e857e2e9c64b840b941 100644 (file)
@@ -1,3 +1,11 @@
+2017-11-01  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2017-10-25  Alan Modra  <amodra@gmail.com>
+       * testsuite/ld-plugin/lto-3r.d: Match "__gnu_lto_v" optionally
+       prefixed with "_".
+       * testsuite/ld-plugin/lto-5r.d: Likewise.
+
 2017-09-28  Alan Modra  <amodra@gmail.com>
 
        * testsuite/ld-plugin/pr22220.h,
index 1d1befe90f687a6bfd0cba38b9adb2f0c3d5f413..3726718f2a069059922dc91f05b44b700c47bc3e 100644 (file)
@@ -3,5 +3,5 @@
 #nm: -p
 
 #...
-[0-9a-f]+ C __gnu_lto_v.*
+[0-9a-f]+ C _?__gnu_lto_v.*
 #pass
index 43e9a5c5a3ca81778972f76292b78cd82b6d11d5..ad1da7047b9c5d0314ce50a7e5a12f15e91d1d50 100644 (file)
@@ -3,5 +3,5 @@
 #nm: -p
 
 #...
-[0-9a-f]+ C __gnu_lto_v.*
+[0-9a-f]+ C _?__gnu_lto_v.*
 #pass