[U-Boot] Some M68K boards are depending the specific order of libraries

Masahiro Yamada yamada.m at jp.panasonic.com
Wed Dec 11 10:32:27 CET 2013


Hi, M68K maintainers.


I noticed at least some M68K boards are expecting the specific order
of libraries for the link stage.

To confirm this problem, check out the current u-boot/master.
(commit f44483b57c49282299da0e5c10073b909cdad979)

And then build, for example, "cobra5272" board.
$ make cobra5272   CROSS_COMPILE=m68k-linux-

The build should succeed.


And then, modify the top Makefile as follows
(omit  $(sort ...)  function)


    --- a/Makefile
    +++ b/Makefile
    @@ -288,7 +288,7 @@ LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
     LIBS-y += board/$(BOARDDIR)/
     
     LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
    -LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
    +LIBS := $(addprefix $(obj),$(LIBS-y))
     .PHONY : $(LIBS)
     


And then, build again
$ make cobra5272   CROSS_COMPILE=m68k-linux-
<<snip>>
arch/m68k/cpu/mcf52x2/start.o: In function `_start':
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:201:(.text+0x448): relocation truncated to fit: R_68K_PC16 against symbol `cpu_init_f' defined in .text.cpu_init_f section in arch/m68k/cpu/mcf52x2/built-in.o
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:202:(.text+0x44c): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in arch/m68k/lib/built-in.o
arch/m68k/cpu/mcf52x2/start.o: In function `_exc_handler':
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:300:(.text+0x4da): relocation truncated to fit: R_68K_PC16 against symbol `exc_handler' defined in .text.exc_handler section in arch/m68k/lib/built-in.o
arch/m68k/cpu/mcf52x2/start.o: In function `_int_handler':
/home/yamada/workspace/u-boot-org/arch/m68k/cpu/mcf52x2/start.S:308:(.text+0x4fc): relocation truncated to fit: R_68K_PC16 against symbol `int_handler' defined in .text.int_handler section in arch/m68k/lib/built-in.o
make[1]: *** [u-boot] Error 1
make[1]: Leaving directory `/home/yamada/workspace/u-boot-org'
make: *** [cobra5272] Error 2



The build will fail with error messages
" relocation truncated to fit: R_68K_PC16 against symbol"

What is this error?


And I'd say such boards are working by luck.
This means, if you add a new library, or delete an obsolete library,
or change the order of libraries, some M68K boards might get broken
all of sudden, with totally unrelated cause.

So I'm thinking the root cause of some M68K boards should be fixed.
For now it is only luckily(unluckily?) hidden.

So, I hope M68K experts will check this.


Best Regards
Masahiro Yamada



More information about the U-Boot mailing list