Does binutils-gold has support for arm/Android?

1.8k Views Asked by At

I am trying to replace my default arm-eabi-ld with installed from binutils-gold ld, however during linking I have got

(..../*.o) requires unsupported dynamic reloc; recompile with -fPIC

LOCAL_CFLAGS := -fPIC in Android.mk doesn't help very much. Is there any chance to use gold linker?

1

There are 1 best solutions below

2
On BEST ANSWER

good news!

Latest version from https://launchpad.net/ubuntu/+source/binutils/2.21.0.20110327-2ubuntu2/+buildjob/2436559 works for me!

my results:

linking with ld: 6 minutes

linking with gold: 1 minute !!!!

installation script:

cd /tmp
wget https://launchpad.net/ubuntu/+source/binutils/2.21.0.20110327-2ubuntu2/+buildjob/2436559/+files/binutils_2.21.0.20110327-2ubuntu2_amd64.deb
wget https://launchpad.net/ubuntu/+source/binutils/2.21.0.20110327-2ubuntu2/+buildjob/2436559/+files/binutils-gold_2.21.0.20110327-2ubuntu2_amd64.deb

sudo dpkg -i binutils-gold_2.21.0.20110327-2ubuntu2_amd64.deb binutils_2.21.0.20110327-2ubuntu2_amd64.deb

cd $ANDROID_NDK_DIR/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/arm-eabi/bin/
mv ld ld.backup
ln -s /usr/bin/ld.gold ld 

cd $ANDROID_NDK_DIR/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/
mv arm-eabi-ld arm-eabi-ld.backup
ln -s /usr/bin/ld.gold arm-eabi-ld