找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 14056|回复: 1
打印 上一主题 下一主题
收起左侧

Warning[25]: Label 'xxx' is defined pubweak in a section implicitly declared ...

[复制链接]
跳转到指定楼层
楼主
ID:91350 发表于 2015-9-30 12:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
IAR编译警告Warning25解决办法STM32

在使用IAR7.7编译工程的时候,出现一大堆Warning[25]: Label 'xxx' is defined pubweak in a section implicitly declared root 的警告,点进去是指到启动文件startup_stm32f10x_xd.s里面的,这个问题有网友说是IAR在早期的版本里面使用了core_cm3文件,而在6以后高版本IAR中就不需要了。解决的办法IAR官方也给出了方案了(文章末尾):

具体做法就是在启动文件里面startup_stm32f10x_xd.s(双击警告可以直接打开),在SECTION .text:CODE:REORDER(1)后面添加一个NOROOT,改成下面这个样子,注意那个数字是在NOROOT后面的。每一个SECTION都添加后保存,再次编译就不会出错了。

  1. Reset_Handler  
  2.         LDR     R0, =SystemInit  
  3.         BLX     R0  
  4.         LDR     R0, =__iar_program_start  
  5.         BX      R0  
  6.           
  7.         PUBWEAK NMI_Handler  
  8.         SECTION .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."

All product names are trademarks or registered trademarks of their respective owners.

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:151834 发表于 2018-10-23 13:20 | 只看该作者
学习了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表