STM32+IAR 解决Warning[25]: Label 'xxxxx' is defined pubweak in a section implicitly declared root

在.text:CODE:REORDER(1)后添加:NOROOT, 改成.text:CODE:REORDER:NOROOT(1)即可

以下为官方文档:

 

Warning[25]: Label 'xxxxx' is defined pubweak in a section implicitly declared root

EW targets:ARM, STM8
EW component:Assembler
Keywords:assembly
Last update:January 12, 2015

Problem
After upgrading to...
EWARM 7.10.1
EWSTM8 2.10.1
...the Warning[25] is issued during assembly of a file that assembled without warning on earlier version of the Embedded Workbench.


Solution
To avoid the warning, add ":NOROOT" to the "SECTION" control directive.
Add the ":NOROOT" to the left of the ()-part of the line.

      PUBWEAK NMI_Handler
      SECTION .text:CODE:REORDER:NOROOT(1)
  NMI_Handler


Background
The assembler is issuing Warning[25] for a deprecated assembler construction.

The deprecated assembler source construction looks like this:

      PUBWEAK NMI_Handler
      SECTION .text:CODE:REORDER(1)
  NMI_Handler


Details
The assembler control directive of "SECTION" consists of:

SECTION section :type [:flag] [(align)]

The change is only to be made among the flag items. I.e. don't change the"SECTION" , "section" , ":type" nor the "[(align)]" parts of the line. (For example if the alignment is expressed as (2) then keep it at (2). (The (2) stands for an alignment of 4 bytes, as the (2) is the power of two to which the address should be aligned.))

The "[:flag]"-part can have these flags:
ROOT (the default mode) or NOROOT
and
REORDER or NOREORDER (the default mode)
Where now the Warning from the Assembler shows that the "explicit noroot", due to the directive "PUBWEAK", mismatch the default mode, which gives an "implied root"
So the "explicit noroot", from "PUBWEAK", should be matched with the flag"NOROOT".

The details for the assembler control directive of "SECTION" can be found in the chapter "Section control directives" in the "IAR Assembler™ Reference Guide."

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值