简体   繁体   English

如何将 map LTO 部分转换为 GCC(臂)Z3175B42760467807B8873 中的 output 部分

[英]How to map LTO sections to output sections in GCC (Arm) linker?

I have a linker file that I use as input for Gnu Arm Embedded Toolchain.我有一个 linker 文件,用作 Gnu Arm 嵌入式工具链的输入。

It contains, among other things, an output section like this:除其他外,它包含一个 output 部分,如下所示:

.text :
{
  . = ALIGN(4);
  *(.text*)
  *(.rodata*)
} > FLASH

, where FLASH is a MEMORY block. ,其中 FLASH 是 MEMORY 块。

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.我的问题是,当我使用 LTO(链接时优化)编译 C++ 文件时,我的一些代码放在生成的 object 文件中的非“.text”部分中。 These sections seems to be consistently named:这些部分的名称似乎一致:

.gnu.lto<SOMETHING>

As a result, they are not placed in my.text output section.因此,它们没有放在 my.text output 部分中。

How can I map LTO input sections to my.text output section?如何将 map LTO 输入部分输入到 my.text output 部分?

It turns out my issue was related to a misunderstanding in how the VMA and LMA statements work in GNU linker files.事实证明,我的问题与对 VMA 和 LMA 语句如何在 GNU linker 文件中工作的误解有关。 So, in essense the LTO section are mapped correctly.因此,从本质上讲,LTO 部分已正确映射。 Thanks to anyone who spent time on this.感谢任何花时间在这方面的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM