aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-07-04 16:39:08 +0200
committerMartin Liska <mliska@suse.cz>2019-07-29 10:11:44 +0200
commitcc5277b173701364c10204f316db28198f2c683b (patch)
treea8f2b4749dc337a6e2b265785fe818c247329371 /bfd/archive.c
parentac50aea1311b01c745afc4dba102a8d20d0eea6e (diff)
downloadbinutils-cc5277b173701364c10204f316db28198f2c683b.zip
binutils-cc5277b173701364c10204f316db28198f2c683b.tar.gz
binutils-cc5277b173701364c10204f316db28198f2c683b.tar.bz2
Support .gnu.lto_.lto section in ELF files (PR 24768).
bfd/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> PR 24768 * archive.c (_bfd_compute_and_write_armap): Come up with report_plugin_err variable. * bfd-in2.h (struct bfd): Add lto_slim_object flag. * elf.c (struct lto_section): New. (_bfd_elf_make_section_from_shdr): Parse content of .gnu_lto_.lto section. * elflink.c: Report error for a missing LTO plugin. * linker.c (_bfd_generic_link_add_one_symbol): Likewise. binutils/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> PR 24768 * nm.c (filter_symbols): Set report_plugin_err if error is reported. (display_rel_file): Report error for a missing LTO plugin. gold/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> PR 24768 * layout.h (class Layout): Add is_lto_slim_object and set_lto_slim_object. * object.cc (struct lto_section): Add lto_slim_object_. (big_endian>::do_layout): Parse content of .gnu_lto_.lto section. (big_endian>::do_add_symbols): Report error for a missing LTO plugin.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/bfd/archive.c b/bfd/archive.c
index 68a92a3..0a7da3a 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -2236,6 +2236,7 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
long syms_max = 0;
bfd_boolean ret;
bfd_size_type amt;
+ static bfd_boolean report_plugin_err = TRUE;
/* Dunno if this is the best place for this info... */
if (elength != 0)
@@ -2270,6 +2271,14 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
long symcount;
long src_count;
+ if (current->lto_slim_object && report_plugin_err)
+ {
+ report_plugin_err = FALSE;
+ _bfd_error_handler
+ (_("%pB: plugin needed to handle lto object"),
+ current);
+ }
+
storage = bfd_get_symtab_upper_bound (current);
if (storage < 0)
goto error_return;
@@ -2322,10 +2331,14 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
&& syms[src_count]->name[1] == '_'
&& strcmp (syms[src_count]->name
+ (syms[src_count]->name[2] == '_'),
- "__gnu_lto_slim") == 0)
- _bfd_error_handler
- (_("%pB: plugin needed to handle lto object"),
- current);
+ "__gnu_lto_slim") == 0
+ && report_plugin_err)
+ {
+ report_plugin_err = FALSE;
+ _bfd_error_handler
+ (_("%pB: plugin needed to handle lto object"),
+ current);
+ }
namelen = strlen (syms[src_count]->name);
amt = sizeof (char *);
map[orl_count].name = (char **) bfd_alloc (arch, amt);