I get a linker warning when creating the most simple project.

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

I get a linker warning when creating the most simple project.

1,244 次查看
simmania
Contributor IV

Hi,

I'm using the latest MCUXpresso IDE. When I use "Create a new C/C++ project..." and create the simplest project possible (no peripherals added), and I compile this, I get the following warning:

warning: MIMXRT1011_Project_Empty.axf has a LOAD segment with RWX permissions

How can I get rid of this?

0 项奖励
回复
1 回复

1,215 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @simmania,

This is an arm-none-eabi GCC warning that occurs when you have data and code residing in the same memory region (aka segment). As stated on the following post: "The memory storing data must be writable (W), and code memory must be executable (X). Both must be readable (R). Thus, a segment that stores both data and code sections is RWX, which leaves your program vulnerable to attacks like buffer overflows."

You can get rid of the warning by simply adding "(READONLY)" for each section that goes only into flash memory. The aforementioned post describes the issue and solution in much more detail, so please take a look into it.

BR,
Edwin.

 

0 项奖励
回复