[U-Boot] [PATCH] Switch from archive libraries to partial linking

Timur Tabi timur at freescale.com
Mon Jan 24 21:54:27 CET 2011


On Mon, Nov 8, 2010 at 4:04 PM, Sebastien Carlier
<sebastien.carlier at gmail.com> wrote:
> NOTE: This does not include the actual patch as it is too large for the mailing list (418 kB).
>
> Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries
> when linking with recent versions of binutils.  As stated in the System V ABI, "the link editor does
> not extract archive members to resolve undefined weak symbols".
>
> This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives,
> which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols
> as intended.  This approach is also used by Linux, from which the gmake function cmd_link_o_target
> (added at the end of config.mk and used in all Makefiles) is inspired.
>
> The name of each former library archive is preserved except for extensions which change from ".a" to
> ".o".  This commit updates references accordingly where needed, in particular in some linker scripts.
>
> This commit reveals board configurations that exclude some module but not all of its dependencies; for
> example, disabling CMD_NET but not CMD_NFS results in undefined symbols at link time.
>
> Signed-off-by: Sebastien Carlier <sebastien.carlier at gmail.com>

git-bisect tells me that your patch (or whatever version of it was
actually applied) causes this linker warning:

powerpc-linux-gnu-ld: Warning: lib_powerpc/fpu/libpostpowerpcfpu.o
uses hard float, libpost.o uses soft float

See this thread for details:
http://lists.denx.de/pipermail/u-boot/2011-January/085811.html

I have no idea how to fix this.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list