免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3182 | 回复: 5
打印 上一主题 下一主题

[BootLoader] uboot 2014.07版本,生成的u-boot.bin内所有c代码都为空,求大神指点 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-06-03 10:57 |只看该作者 |倒序浏览
uboot 2014.07版本,移植一个新板子,mips的,但是生成的u-boot.bin内所有c代码都为空,启动的时候一直卡在board_init_f进不去,后来发现根本没代码,是不是Makefile的问题?
    .....
    1118:   21186900    addu    v1,v1,t1
    111c:   00000000    nop
    1120:   ffffffff    sd  ra,-1(ra)
    1124:   ffffffff    sd  ra,-1(ra)
    1128:   ffffffff    sd  ra,-1(ra)
    112c:   ffffffff    sd  ra,-1(ra)
    1130:   ffffffff    sd  ra,-1(ra)
    1134:   ffffffff    sd  ra,-1(ra)
    1138:   ffffffff    sd  ra,-1(ra)
    113c:   ffffffff    sd  ra,-1(ra)
    1140:   ffffffff    sd  ra,-1(ra)
    1144:   ffffffff    sd  ra,-1(ra)
    1148:   ffffffff    sd  ra,-1(ra)
    114c:   ffffffff    sd  ra,-1(ra)
    1150:   ffffffff    sd  ra,-1(ra)
    ......

论坛徽章:
0
2 [报告]
发表于 2015-06-03 18:15 |只看该作者
是不是没有链接上?

论坛徽章:
0
3 [报告]
发表于 2015-06-04 09:57 |只看该作者
加上 -T boardpath/u-boot.lds 的链接参数后出现报错,不知道为什么

arch/mips/cpu/ls1a/built-in.o: In function `do_reset':
(.text.do_reset+0x2c): relocation truncated to fit: R_MIPS_GOT16 against `$LC0'
board/ls1a/built-in.o.text+0x3c): relocation truncated to fit: R_MIPS_GOT16 against `no symbol'
board/ls1a/built-in.o.text+0x70): relocation truncated to fit: R_MIPS_GOT16 against `no symbol'
board/ls1a/built-in.o.text+0x8c): relocation truncated to fit: R_MIPS_GOT16 against `no symbol'
board/ls1a/built-in.o: In function `ddr2_config':
(.text+0x170): relocation truncated to fit: R_MIPS_GOT16 against `no symbol'
board/ls1a/built-in.o: In function `reg_write':
board/ls1a/kbd.c.text+0x1ac): relocation truncated to fit: R_MIPS_GOT16 against `no symbol'
board/ls1a/built-in.o: In function `_machine_restart':
(.text._machine_restart+0xc): relocation truncated to fit: R_MIPS_GOT16 against `mips_io_port_base'
board/ls1a/built-in.o: In function `checkboard':
(.text.checkboard+0x1c): relocation truncated to fit: R_MIPS_CALL16 against `printf'
board/ls1a/built-in.o: In function `checkboard':
(.text.checkboard+0x1: additional relocation overflows omitted from the output
make: *** [u-boot] 错误 1

论坛徽章:
0
4 [报告]
发表于 2015-06-04 12:55 |只看该作者
回复 3# sunpat

看到Makefile中已经指定 -T 参数了,我在手动指定后就会出现这些错误,不过在查找这些错误的解决方案过程中还是学习到不少东西,上午已经锁定是链接的问题,手动加载了c的第一个built-in.o到链接脚本里,去调试就能跑到c了,bin文件也有代码了,现在不明白的是为什么make的时候ld会失败,还没报错,编译的时候还显示了 LD xxx/built-in.o的字样,奇怪了,keep going

论坛徽章:
0
5 [报告]
发表于 2015-06-05 12:38 |只看该作者
回复 4# sunpat

今天上午弄puts("DRAM   ") ,发现只要一进入serial_printf(const char *fmt, ...) fmt的值就不对了(gdb看的),好奇怪,中间就是一个宏定义转换,没经过什么啊。
PS:把define puts serial_printf 去掉,直接调用serial_printf也会变,不知道为什么


Breakpoint 1, init_func_ram () at arch/mips/lib/board.c:167
167 puts ("DRAM:  ");
(gdb) s
serial_printf (fmt=0xbfc24f90 '\377' <repeats 200 times>...)
    at arch/mips/lib/board.c:153
153 i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args);
   

论坛徽章:
0
6 [报告]
发表于 2015-06-05 14:56 |只看该作者
回复 5# sunpat

我怀疑是因为我虽然吧text段强行链接到了一起,但是数据段却没有,导致夸文件的函数传参过程出错,又回到原来问题了, 为啥链接会失败,失败了为啥没报错,继续纠结。。。


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

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP