This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Share a prevailing name for remove debug info symbols w/ LTO.
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Ian Lance Taylor <iant at golang dot org>
- Date: Tue, 27 Aug 2019 12:40:44 +0200
- Subject: Re: [PATCH] Share a prevailing name for remove debug info symbols w/ LTO.
- References: <1f4487be-6bd6-c2df-6b43-6b41dd326cb0@suse.cz>
On Tue, Aug 27, 2019 at 9:28 AM Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> The patch is about better symbol table manipulation
> for debug info objects. The patch fixes reported issue
> on hppa64-hp-hpux11.11.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
+ prevailing_name_idx = ELF_FETCH_FIELD (type_functions, ei_class,
+ Sym, ent,
+ st_name, Elf_Addr);
this should be Elf_Word. Please add a break; after you found a symbol.
Please also amend the comment before this loop to say that we know
there's a prevailing weak hidden symbol at the start of the .debug_info section
so we'll always at least find that one.
- undefined and sharing the gnu_lto_ name. */
+ undefined and sharing a name of a prevailing
+ symbol. */
bind = STB_WEAK;
other = STV_HIDDEN;
+
ELF_SET_FIELD (type_functions, ei_class, Sym,
- ent, st_name, Elf_Word,
- gnu_lto - strings);
+ ent, st_name, Elf_Addr,
+ prevailing_name_idx);
+
Likewise Elf_Word, no need to add vertical spacing before and after
this stmt.
ELF_SET_FIELD (type_functions, ei_class, Sym,
> Thanks,
> Martin
>
> libiberty/ChangeLog:
>
> 2019-08-27 Martin Liska <mliska@suse.cz>
>
> PR lto/91478
> * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
> First find a WEAK HIDDEN symbol in symbol table that will be
> preserved. Later, use the symbol name for all removed symbols.
> ---
> libiberty/simple-object-elf.c | 71 +++++++++++++++++++++++------------
> 1 file changed, 48 insertions(+), 23 deletions(-)
>
>