If in my linker script I have this:
.ARM.exidx :
{
. = ALIGN(4);
PROVIDE(__exidx_start = .);
*(.ARM.exidx* .gnu.linkonce.armexidx.*);
. = ALIGN(4);
PROVIDE(__exidx_end = .);
} > rom AT > rom
I get following warning when building the project:
/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'
So I move the symbols "out" of the section:
. = ALIGN(4);
PROVIDE(__exidx_start = .);
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*);
} > rom AT > rom
. = ALIGN(4);
PROVIDE(__exidx_end = .);
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:
.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));