I have a linker file that I use as input for Gnu Arm Embedded Toolchain.
It contains, among other things, an output section like this:
.text :
{
. = ALIGN(4);
*(.text*)
*(.rodata*)
} > FLASH
, where FLASH is a MEMORY block.
My issue is that, when I compile a C++ file with LTO (link-time optimization), some of my code is put in non-".text" sections in the resulting object files. These sections seems to be consistently named:
.gnu.lto<SOMETHING>
As a result, they are not placed in my .text output section.
How can I map LTO input sections to my .text output section?
some of my code is put in non-".text" sections in the resulting object files
And? Looks like they belong there. What is the reasoning for why do you want not to put them there? Is this XY question? It sounds like you have a bug in your code, that bug is manifesting only with LTO, and you are trying to fix something unrelated. Most probably, as usuall, your interrupt vectors get optimized out. – KamilCuk