u-boot 相关问题与知识

本文解决使用arm-linux-gcc4.3.2编译u-boot-1.1.6时遇到的undefined reference错误,并推荐使用arm-linux-gcc3.4.5进行编译。此外,还介绍了如何通过特定寄存器存储全局数据指针。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、用arm-linux-gcc 4.3.2 编译 u-boot-1.1.6 出现 In function `__aeabi_ldiv0':
(.text+0x8): undefined reference to `raise'...


  编译u-boot-1.1.6 使用 arm-linux-gcc 3.4.5即可。

   其他相关阅读

   1) http://www.arm9home.net/simple/index.php?t1960.html

   2) http://kongweile.iteye.com/blog/1576113 (ABI与EABI)

 

2、#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")

      这个声明告诉编译器使用寄存器r8来存储gd_t类型的指针gd,即这个定义声明了一个指针,并且指明了它的存储位置。
       register表示变量放在机器的寄存器
       volatile用于指定变量的值可以由外部过程异步修改

      并且这个指针在start_armboot()(board.c)中被初始化:
              /* Pointer is writable since we allocated a register for it */
              gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));

       这样,gd就指向的一个可用的内存地址了。

       原文:http://hi.baidu.com/rwen2012/item/783c47cf40d23427e80f2e51


3、__asm__ __volatile__("": : :"memory");

     这是GCC内嵌汇编,详见:http://topic.csdn.net/u/20090521/11/35609357-57b9-4c7c-af6a-04a76eef49a3.html




       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值