bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: GNU strip fails to set sh_link and sh_info on Solaris SPARC64


From: Libor Bukata
Subject: Re: Re: GNU strip fails to set sh_link and sh_info on Solaris SPARC64
Date: Fri, 5 Mar 2021 13:32:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi Nick,

On 3/5/21 12:11 PM, Nick Clifton wrote:
Hi Libor,

thank you for ideas. Obviously, the biggest problem is that we know too late whether the symbol section is empty and it is difficult to remove already created output sections (requires hacks). In that case, a safer and cleaner solution (but slow) is to call strip in two phases> Not sure whether I should attempt to implement it since this performance bottleneck could be no-go.

Safe and slow but working is better than fast and broken...
I discussed the issue with Ali Bahrami and there is 1-1 mapping between .symtab and .SUNW_sym*sort sections. In other words, if some symbols are striped from .symtab (very likely), it makes sort sections unusable.

I forgot whther you said that having these sections present in a file when the symbol table is missing actually causes problems with their execution.
I have not encountered any runtime issues during the execution, the runtime editor simply ignores these sections.

The only problem is that ELF binary contains orphaned sections that points to .symtab:
$ gstrip test
gstrip: stGfAJVb: failed to find link section for section 28
gstrip: stGfAJVb: failed to find link section for section 28
gstrip: stGfAJVb: failed to find link section for section 29
gstrip: stGfAJVb: failed to find link section for section 29

Even if .symtab section is shorten and .SUNW_sym*sort sections are kept, the binary still runs fine.

  If it does not then the simplest solution is to do nothing and just leave them in.  (A slightly better solution would be to add a comment to the code explaining why the sections are not removed).

Or we can simply remove them unconditionally on Solaris since they are not mandatory for binary execution.

Thank you for your help. Ali Bahrami gives you regards.

Cheers,
Libor


Cheers
  Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]