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]

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


Hi all!

If in my linker script I have this:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

	.ARM.exidx :
	{
		. = ALIGN(4);
		PROVIDE(__exidx_start = .);

		*(.ARM.exidx* .gnu.linkonce.armexidx.*);

		. = ALIGN(4);
		PROVIDE(__exidx_end = .);
	} > rom AT > rom

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

I get following warning when building the project:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

    /home/freddie/arm-none-eabi-gcc-7.1.0-170503/bin/../lib/gcc/arm-
none-eabi/7.1.0/../../../../arm-none-eabi/bin/ld:
output/./application.elf: warning: sh_link not set for section
`.ARM.exidx'

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

So I move the symbols "out" of the section:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

	. = ALIGN(4);
	PROVIDE(__exidx_start = .);

	.ARM.exidx :
	{
		*(.ARM.exidx* .gnu.linkonce.armexidx.*);
	} > rom AT > rom

	. = ALIGN(4);
	PROVIDE(__exidx_end = .);

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

The warning is gone... What's the difference? Due to the fact that I
generate linker script automatically, I would really prefer to have the
symbols "in" the section - then there's no difference what memory
region (here "flash") was used for previous section.

Interestingly, another "generic" approach suitable for automatic
generation gives exactly the same warning:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

	.ARM.exidx :
	{
		*(.ARM.exidx* .gnu.linkonce.armexidx.*);
	} > rom AT > rom

	PROVIDE(__exidx_start = ADDR(.ARM.exidx));
	PROVIDE(__exidx_end = ADDR(.ARM.exidx) + SIZEOF(.ARM.exidx));

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Any help appreciated - thanks in advance!

Regards,
FCh


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