Specifying linker section

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Specifying linker section

跳至解决方案
2,262 次查看
davidsherman
Senior Contributor I

According to the GCC documentation, if I add __attribute__((section("section name")) to a declaration, I can specify a section.  However, the linker file has warnings saying don't touch it.  I don't see any settings under the project properties for locating sections.  How does one specify a specific location for something?  I'm using Processor Expert, so that's where the warning not to edit the linker file comes from.

标签 (1)
0 项奖励
回复
1 解答
1,841 次查看
BlackNight
NXP Employee
NXP Employee

You can disable the linker file generation, see last dialog in Disable my Code Generation | MCU on Eclipse

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,841 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi David,

did you define the section in ld file?

please refer

https://community.freescale.com/docs/DOC-101437

"2.1 . No fill() command involved."

this works on my side without any error.

Hope this helps!

====================================================================

this answer is for you. if it helps, please click on "correct answer" button. thanks!

Best Regards,

ZhangJun

0 项奖励
回复
1,841 次查看
davidsherman
Senior Contributor I

At the top of the ld file:

/* ################################################################### */

/*##

/*##     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT. */

/*##                                   */

/*##     Filename  : ProcessorExpert.ld */

So, if I modify the file and ProcessorExpert overwrites it if I change something, how does one specify the section that makes Processor Expert aware of it?  I have confirmed that PE overwrites the ld file, removing my edits.

0 项奖励
回复
1,842 次查看
BlackNight
NXP Employee
NXP Employee

You can disable the linker file generation, see last dialog in Disable my Code Generation | MCU on Eclipse

0 项奖励
回复
1,841 次查看
davidsherman
Senior Contributor I

Ah, thank you Erich.  Being able to turn off the code generation when it's not wanted could be useful, and that's exactly what I need to be able to control the linker sections.  Thanks!

0 项奖励
回复