This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to properly avoid warning about sh_link not set for section “.ARM.exidx”?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]