KEIL MDK-ARM升级v5.34后报 warning: Reset_Handler changed binding to STB_WEAK

问题:之前的版本没有类似的warning, 升级KEIL到最新版本5.34后编译会有warning,

C:xx\startup_xxx.S(94): warning: Reset_Handler changed binding to STB_WEAK

原因:这是由于KEIL MDK-ARM升级后对于改变binding会触发warning,在以后的版本中会触发error。

我们可以看到报warning的.S文件中有下列汇编声明:

    .globl   Reset_Handler
    .weak    Reset_Handler

从ARM得到的信息是他们在5.34做了改进,背景如下:

GNU as let .weak override .globl since binutils-gdb
5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996) while MC lets the last
directive win (PR38921).

This caused an issue to Linux's powerpc port which has been fixed by
http://git.kernel.org/linus/968339fad422a58312f67718691b717dac45c399

Binding overriding is error-prone. This patch disallows a changed binding.
(https://sourceware.org/pipermail/binutils/2020-March/000299.html )

Our behavior regarding .globl x; .weak x matches GNU as. Such usage is
still suspicious but we issue a warning for now. We may upgrade it to an
error in the future.

解决方法:

将.globl Reset_Handler这一行声明去掉。

延展: 关于Symbol binding

参阅 https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_drn1510589975221.htm

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值