【问题标题】:Aarch64 u-boot compile issueAarch64 u-boot 编译问题
【发布时间】:2014-10-10 20:25:07
【问题描述】:

我目前在为 u-boot 编译时遇到了一个非常奇怪的错误:

向量

init_fnc_t *init_sequence[] ={...}

用 0/NULL 代替函数指针填充。我认为我通过“手动”调用所有这些函数来胜过编译器。然而,由于驱动结构也获得了 0 / NULL 指针,因此这个 bug 会产生更多影响:

static struct serial_device my_serial_drv = {
    .name = "my_serial",
    .start = my_serial_init,
    .stop = NULL,
    .setbrg = my_serial_setbrg,
    .putc = my_serial_putc,
    .puts = my_serial_puts,
    .getc = my_serial_getc,
    .tstc = my_serial_tstc,
};

当然,当我打电话时

 'my_serial_drv'->start(); 

将 pc 设置为 0 并随后使一切崩溃。

有趣的事实:.name 到达二进制文件,所以 .data 部分一旦设置就可能没问题。

我已经使用 aarch64-linux-gnu-*-4.7 和 aarch64-linux-gnu-*-4.9 二进制文件对此进行了测试。 您可以从以下位置找到 4.9: http://releases.linaro.org/latest/components/toolchain/binaries.

任何帮助将不胜感激:)

【问题讨论】:

  • u-boot 什么版本?您是否尝试过使用 denx 的 ELDK 编译器? denx.de/wiki/view/DULG/ELDKAvailability 如果其他编译器出现编译问题,我总是回退到 ELDK。
  • ELDK 不支持 arm64(或 aarch64)。我已经从 u-boot git clone 开始工作,最后一次公开提交:c9aab0f9dd23fddcebf5984dc19e62b514e759a7 2014 年 4 月 21 日星期一 21:01:35 +0200
  • c9aab0f9dd23fddcebf5984dc19e62b514e759a7 是很久以前的事了!尽管您的问题似乎与工具链相关,而不是与 u-boot 相关。如果您浏览 u-boot 邮件列表,没有人会报告与您相同的问题。 news.gmane.org/gmane.comp.boot-loaders.u-boot

标签: u-boot arm64


【解决方案1】:

u-boot.bin 文件似乎没问题。在调查了为什么这行得通后,我看到 u-boot 的 make 正在运行一个单独的命令来修复 bin:

start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' ');
end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); 
tools/relocate-rela u-boot.bin 0x3e900000 $start $end

(这些是单行,但为了便于阅读,我将其拆分)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-08
    • 2018-08-06
    • 1970-01-01
    • 2021-10-20
    • 2020-04-26
    • 1970-01-01
    • 2020-04-13
    • 2016-05-05
    相关资源
    最近更新 更多