[U-Boot] u-boot linker problem

Dennis Jacobs dennis.jacobs2 at prodrive-technologies.com
Mon May 14 07:00:16 UTC 2018


Dear U-boot mailing list

During the development of a boot loader for a Marvel armv7-a Ethernet switch (98DX3235) I found a linker problem causing u-boot to not recognize any commands.

Development tools:

u-boot 2013.01 with 2016_T1.0.eng_drop_v6 Marvell modifications extracted over it.

CROSS_COMPILER = armv7-marvell-linux-gnueabi-hard-4.6.4_64K_i686_20160226/bin/arm-marvell-linux-gnueabi-


CROSS_COMPILE_BH = armv7-marvell-linux-gnueabi-hard-4.6.4_64K_i686_20160226/bin/arm-marvell-linux-gnueabi-



To be clear I was able to compile, Load trough UART and even execute u-boot. Everything works fine until I get to the u-boot prompt line. I found out that no commands where recognized by u-boot because the commands are not listed in the right address category.



u-boot searches in a list between 2 address locations, _u_boot_list_cmd__end and _u_boot_list_cmd__start. As you can see in the following address list created by u-boot called System.map, The commands are not sorted between the earlier mentioned address locations



-----------------------------System.map-----------------------------

3076 000b6cd4 D _u_boot_list__end

3077 000b6cd4 D _u_boot_list_cmd_Creset

3078 000b6cf0 D _u_boot_list_cmd_SatR

3079 000b6d0c D _u_boot_list_cmd_active_units

3080 000b6d28 D _u_boot_list_cmd_base

3081 000b6d44 D _u_boot_list_cmd_bdinfo

3082 000b6d60 D _u_boot_list_cmd_boot

3083 000b6d7c D _u_boot_list_cmd_bootd

< " " more commands in list" ">

3193 000b7984 D _u_boot_list_cmd_ubifsmount

3194 000b79a0 D _u_boot_list_cmd_ubifsumount

3195 000b79bc D _u_boot_list_cmd_usb

3196 000b79d8 D _u_boot_list_cmd_usbboot

3197 000b79f4 D _u_boot_list_cmd_version

3198 000b7a10 D _u_boot_list_cmd_whoAmI

3199 000b7a2c D _u_boot_list_env_clbk_baudrate

3200 000b7a34 D _u_boot_list_env_clbk_bootfile

3201 000b7a3c D _u_boot_list_env_clbk_callbacks

3202 000b7a44 D _u_boot_list_env_clbk_console

3203 000b7a4c D _u_boot_list_env_clbk_flags

3204 000b7a54 D _u_boot_list_env_clbk_loadaddr

3205 000b7a5c A __image_copy_end

3206 000b7a5c B __bss_start

3207 000b7a5c D _u_boot_list__start

3208 000b7a5c D _u_boot_list_cmd__end

3209 000b7a5c D _u_boot_list_cmd__start

3210 000b7a5c D _u_boot_list_env_clbk__end

3211 000b7a5c D _u_boot_list_env_clbk__start

--------------------------------------------------------------------------



The following code form include/u-boot.lst shows that the commands should be sorted between the earlier mentioned addresses but they are not.



-----------------------------include/u-boot.lst-----------------------------

  1 _u_boot_list__end = .;

  2 *(SORT(.u_boot_list.*));

  3 _u_boot_list__start = .;

  4 _u_boot_list_cmd__end = .;

  5 *(SORT(.u_boot_list.cmd.*));

  6 _u_boot_list_cmd__start = .;

  7 _u_boot_list_env_clbk__end = .;

  8 *(SORT(.u_boot_list.env_clbk.*));

  9 _u_boot_list_env_clbk__start = .;
-------------------------------------------------------------------------------------

I would like you to rank posible solutions listed below
- Am I using the wrong cross compiler?
- Should I not use the same cross compiler for u-boot and the binary header?
- Should the sorting  order be ending with the sorting of u_boot_list prefixes so the others get sorted first?
- Do you have another possible solution?

Great thanks for all help of the u-boot mailing list

Kind regards,

Dennis Jacobs




More information about the U-Boot mailing list