ERROR: bad reloc type 6
host: ubuntu linux
toolchain: sparc-linux-1.0.1
uClinux: snapgear-p33(linux-2.0.x and uClibc)
写个简单的c++程序:testcpp.cxx
#include <iostream>
using namespace std;
int main(int argc,char **argv) {
cout<<"Hello world, i am a cxx program!"<<endl;
return 1;
}
----------------------------------------------------------------------------------------------------
Makefile中相关语段如下:
LDXXFLAGS=-nostartfiles -L/home/ky/embeded/snapgear-p33a/lib/uClibc/lib -Bstatic -elf2flt
LDXXLIBS=-nodefaultlibs -L/opt/sparc-linux/sparc-linux/lib-uclibc-stdc++ -lc -lstdc++ -lgcc /home/ky/embeded/snapgear-p33a/lib/uClibc/lib/crt1.o /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/crtbegin.o /home/ky/embeded/snapgear-p33a/lib/uClibc/lib/crti.o /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/crtend.o /home/ky/embeded/snapgear-p33a/lib/uClibc/lib/crtn.o
%o : %cxx
$(CXX) -v -I /opt/sparc-linux/include/c++/3.2.2 -I /opt/sparc-linux/include/c++/3.2.2/backward -I /opt/sparc-linux/include/c++/3.2.2/sparc-linux -I /opt/sparc-linux/sparc-linux/include -I /opt/sparc-linux/sparc-linux/sys-include $(CFLAGS) -c -o $@ $<
testcpp: testcpp.o
sparc-linux-g++ -Wl,--start-group $(LDXXFLAGS) -o testcpp testcpp.o $(LDXXLIBS) -Wl,--end-group
-------------------------------------------------------------------------------------------------------
make时候shell中提示信息如下:
make[2]: Entering directory `/home/ky/embeded/snapgear-p33a/user/custom'
sparc-linux-gcc -Wl,--start-group -nostartfiles -L/home/ky/embeded/snapgear-p33a/lib/uClibc/lib -Bstatic -elf2flt -o testcpp testcpp.o -nodefaultlibs -L/opt/sparc-linux/sparc-linux/lib-uclibc-stdc++ -lc -lstdc++ -lgcc /home/ky/embeded/snapgear-p33a/lib/uClibc/lib/crt1.o /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/crtbegin.o /home/ky/embeded/snapgear-p33a/lib/uClibc/lib/crti.o /opt/sparc-linux/sparc-linux/lib-uclibc-stdc++/crtend.o /home/ky/embeded/snapgear-p33a/lib/uClibc/lib/crtn.o -Wl,--end-group
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
ERROR: bad reloc type 6
44 bad relocs
collect2: ld returned 1 exit status
make[2]: *** [testcpp] error
make[2]: Leaving directory `/home/ky/embeded/snapgear-p33a/user/custom'
make[1]: *** [all] error
make[1]: Leaving directory `/home/ky/embeded/snapgear-p33a/user'
make: *** [subdirs] error
这种错误是什么原因?给为帮帮忙~~
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论