This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to properly avoid warning about sh_link not set for section “.ARM.exidx”?
- From: Nick Clifton <nickc at redhat dot com>
- To: Freddie Chopin <freddie_chopin at op dot pl>, binutils at sourceware dot org
- Date: Thu, 31 Aug 2017 14:26:27 +0100
- Subject: Re: How to properly avoid warning about sh_link not set for section “.ARM.exidx”?
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=nickc at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 059F7C058EDA
- References: <1503402916.1787.11.camel@op.pl>
Hi Freddie,
> .ARM.exidx :
> {
> . = ALIGN(4);
> PROVIDE(__exidx_start = .);
> *(.ARM.exidx* .gnu.linkonce.armexidx.*);
> I get following warning when building the project:
> output/./application.elf: warning: sh_link not set for section
> `.ARM.exidx'
> So I move the symbols "out" of the section:
> . = ALIGN(4);
> PROVIDE(__exidx_start = .);
> .ARM.exidx :
> {
> *(.ARM.exidx* .gnu.linkonce.armexidx.*);
> The warning is gone... What's the difference?
For most ELF sections the sh_link field points to the symbol table to
be used by entries in that section. (Sometimes it points to a string
table instead, but ignore that for now). Thus if you have symbols that
are specific to that section then you would expect the sh_link field to
point to a symbol table section. If the section does have any symbols
associated with it, then there is no need to have an initialised sh_link
field.
I find it strange however that the linker is not able to handle this case
as the default ARM linker script also includes a description of the .ARM.exidx
section with symbols inside it. I would suggest that you file a binutils
bug report here:
https://sourceware.org/bugzilla
Including a test case will be really helpful.
Cheers
Nick