Chinaunix首页 | 论坛 | 博客
  • 博客访问: 38549
  • 博文数量: 5
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2013-10-22 15:57
文章分类

全部博文(5)

文章存档

2014年(5)

我的朋友
最近访客

分类: 嵌入式

2014-03-05 18:31:14

原文地址:关于R_ARM_CALL编译错误 作者:wloveg

原文地址:http://hi.baidu.com/vim_li/blog/item/5ae3f839749701e515cecbc9.html

 

1、刚刚完成bootloader部分的框架及Makefile,写了几个driver,编译后,链接时,出现下面错误:

ipl/ipl.o: In function `low_level_init':
ipl.c:(.text+0x28): relocation truncated to fit: R_ARM_CALL against symbol `system_clk_init' defined in .text section in /work/new_plat/bootloader/drivers/libdrivers.a(clock.o)
ipl.c:(.text+0x2c): relocation truncated to fit: R_ARM_CALL against symbol `serial_init' defined in .text section in /work/new_plat/bootloader/drivers/libdrivers.a(serial.o)
make: *** [bootloader] Error 1

原因:外部函数调用时,指令跳转返回太长,超出了ARM instruction的范围(The maximum branch is +/- 32Mbytes in ARM mode and +/- 4Mbytes in Thumb mode.)

解决方法:

对于C文件来说,编译选项CFLAGS加入'-mlong-calls'选项;

对汇编文件来说,使用如下的跳转指令

ldr r4, =func

mov lr, pc

bx r4


阅读(1819) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:linux2.6内核Makefile详解

给主人留下些什么吧!~~