[U-Boot-Users] [PATCH] Fixup relocation patch.]

Joakim Tjernlund
2007-02-13T16:40:51Z

On Tue, 2007-02-13 at 17:21 +0100, Txema Lopez wrote:
> Grant Likely wrote:
>
> >I needed to add the -mrelocatable flag to the linker flags in cpu/ppc4xx/config.mk (I did not remove the -fPIC flag when I did this). Without -mrelocatable, the .fixup section would remain empty.
> >
> >
> It's not the case of the MPC5200. It's enough with the -fPIC flag. It
> could be a problem with the gcc cross compiler/linker for the ppc4xx.
>

I added -mrelocatable to gcc during compile, but not to the linking
stage and that worked too.

How do you guys link? This is how I do:
UNDEF_SYM=`powerpc-softfloat-linux-gnu-objdump -x lib_generic/libgeneric.a board/tmcu/libtmcu.a cpu/mpc83xx/libmpc83xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a cpu/mpc83xx/qe/ucc/libucc.a cpu/mpc83xx/qe/libqe.a |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /usr/local/src/tm-uboot/u-boot && powerpc-softfloat-linux-gnu-ld -Bstatic -T /usr/local/src/tm-uboot/u-boot/board/tmcu/u-boot.lds -Ttext 0xF8020000 -n $UNDEF_SYM cpu/mpc83xx/start.o cpu/mpc83xx/resetvec.o \
--start-group lib_generic/libgeneric.a board/tmcu/libtmcu.a cpu/mpc83xx/libmpc83xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a cpu/mpc83xx/qe/ucc/libucc.a cpu/mpc83xx/qe/libqe.a --end-group -L /usr/lib/gcc/powerpc-softfloat-linux-gnu/3.4.6 -lgcc \
-Map u-boot.map -o u-boot