关于Relocations in generic ELF (EM: 40)的解决办法

本文介绍了解决imx6Q平台使用gcc4.6.2交叉编译时无法生成ko文件的问题。通过确保Makefile中CC和LD变量正确配置为同一套交叉编译工具链,成功解决了编译过程中的障碍。

问题描述:交叉编译 imx6Q光盘自带 gcc4.6.2


编译模块时.o已生成但无法生成ko文件


解决办法:


首先检查交叉编译工具链是否指定正确,在Makefile里查看CC的设置,如果设置正确查看LD的设置,必须用同一套的交叉编译工具链。


将CC、LD指定为

…/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/bin/arm-none-linux-gnueabi-gcc

…/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/bin/arm-none-linux-gnueabi-ld

问题解决。

luyanxi@ubuntu:~/Desktop/nvmp/nt98566/nvmp/build_dir/target-arm-ca9-linux-uclibcgnueabihf-cx45ziv1/main/libraries/ams/aad$ gcc -shared -o aad.so *.o -fPIC /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) /usr/bin/ld: aad.o: Relocations in generic ELF (EM: 40) aad.o: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status
10-30
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值