[U-Boot] [PATCH/RFC] Reintegration of ns9750

Albert ARIBAUD albert.u.boot at aribaud.net
Sun Jun 8 21:08:46 CEST 2014


Hi Marek,

On Sat, 22 Mar 2014 19:27:48 +0100, Marek Vasut <marex at denx.de> wrote:

> On Saturday, March 22, 2014 at 11:18:05 AM, Rikard Söderström wrote:
> > Hi Marex,
> > 
> > Are you referring to the code or the linkage issue as "nasty"?
> 
> Actually, both. But more the linker issue this time ;-)

Ok, here is my take on the issue(s), based on the build messages. First
the compiler warnings:

> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/ns9750dev.c: In function 'board_init':
> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/ns9750dev.c:68:2: warning: #warning Please register your machine at http: [-Wcpp]

Hmm, apparently U-Boot targets now have to register to 'teh Internetz'.
That, or the warning above is being cut down because of the '//' in
the URL, which cpp sees as a comment-to-end-of-line. :)

> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function 'flash_get_offsets':
> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:122:10: warning: variable 'pOrgDef' set but not used [-Wunused-but-set-variable]
> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function 'flash_erase':
> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:263:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In function 'write_data':
> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:439:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable]

Those are trivial to solve. :)

> /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c: In
> function
> 'flash_init': /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:132:16:
> warning: array subscript is above array bounds
> [-Warray-bounds] /home/albert.u.boot/src/u-boot-arm/board/ns9750dev/flash.c:133:18:
> warning: array subscript is above array bounds [-Warray-bounds]

Those, please investigate. I hate it when the compiler says indexes
might be out of bounds, because it will invariably result in them
*actually* getting out of bounds, in a manner which will make it
really hard to realize they did.
 
> /home/albert.u.boot/src/u-boot-arm/lib/time.c:14:2: warning: #warning "CONFIG_SYS_HZ must be 1000 and should not be defined by platforms" [-Wcpp]

This one we have treated before.

> arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
> arm-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script
> arm-linux-gnueabi-ld.bfd: final link failed: Invalid operation

I've tried adding .rel.plt manually, but I got the same error. O_o

Then instead of using MAKEALL, I tried make clean && make
ns9750dev_config && make V=1... And got linker errors that I didn't get
with MAKEALL:

> arch/arm/lib/built-in.o: In function `board_init_r':
> /home/albert.u.boot/src/u-boot-arm/arch/arm/lib/board.c:662: undefined reference to `eth_initialize'
> arch/arm/lib/built-in.o:(.data.init_sequence+0xc): undefined reference to `env_init'
> common/built-in.o: In function `env_relocate':
> /home/albert.u.boot/src/u-boot-arm/common/env_common.c:269: undefined reference to `env_relocate_spec'
> drivers/serial/built-in.o: In function `get_current':
> /home/albert.u.boot/src/u-boot-arm/drivers/serial/serial.c:352: undefined reference to `default_serial_console'
> drivers/serial/built-in.o: In function `serial_initialize':
> /home/albert.u.boot/src/u-boot-arm/drivers/serial/serial.c:256: undefined reference to `default_serial_console'
> arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
> arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
> arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
> arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
> arm-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script
> arm-linux-gnueabi-ld.bfd: final link failed: Invalid operation

So I wonder whether the linker error shown by MAKEALL is a rightful
error or just the result of previous linker issues. I would suggest
going after the undefined references then check again whether the
message about .rel.plt still comes up. 

Also: I wonder why building with make shows errors that MAKEALL doesn't.

> make[1]: *** [u-boot] Error 1
> make: *** [sub-make] Error 2

> Best regards,
> Marek Vasut


Amicalement,
-- 
Albert.


More information about the U-Boot mailing list