OpenCores
no use no use 1/1 no use no use
linking error with or32-elf-ld
by scan15g on Mar 23, 2013
scan15g
Posts: 5
Joined: Mar 15, 2013
Last seen: May 14, 2015
Hi, all

I have got a problem while linking object files which are compiled with or32-elf-g++.

First openrisc toolchain have been successfully installed as I think.
I used the "or32-elf-g++" to compile C + + files,
and "or32-elf-ld" to link the object files have been compiled.

However, the following error messages appeared.

The follow line is the command I typed.

or32-elf-ld init.o test.o -o eprom.elf -T or32.ld -Map eprom.map -L /opt/openrisc/or32-elf/lib/ -L /opt/openrisc/lib/gcc/or32-elf/4.5.1-or32-1.0rc4/ -lgcc -lc -lstdc++

And small part of error messages....

/opt/openrisc/or32-elf/lib//libstdc++.a(new_op.o): In function `operator new(unsigned long)':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/new_op.cc:52: undefined reference to `malloc'
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/new_op.cc:63: undefined reference to `malloc'
/opt/openrisc/or32-elf/lib//libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:102: undefined reference to `malloc'
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:135: undefined reference to `memset'
/opt/openrisc/or32-elf/lib//libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:156: undefined reference to `free'
/opt/openrisc/or32-elf/lib//libstdc++.a(eh_alloc.o): In function `__cxa_allocate_dependent_exception':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:166: undefined reference to `malloc'
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:197: undefined reference to `memset'
/opt/openrisc/or32-elf/lib//libstdc++.a(eh_alloc.o): In function `__cxa_free_dependent_exception':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:219: undefined reference to `free'
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/eh_alloc.cc:213: undefined reference to `__udivsi3'
/opt/openrisc/or32-elf/lib//libstdc++.a(del_op.o): In function `operator delete(void*)':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/del_op.cc:44: undefined reference to `free'
/opt/openrisc/or32-elf/lib//libstdc++.a(si_class_type_info.o): In function `std::type_info::operator==(std::type_info const&) const':
/opt/gnu-stable/bd-elf/or32-elf/libstdc++-v3/libsupc++/../../../../unisrc/libstdc++-v3/libsupc++/typeinfo:123: undefined reference to `strcmp'

What is the problem?
I guess it looks like the linker can not find the C library.

What should I do to fix this error?

Can somebody help me know exactly what am I missing?

Thank you

Kim
no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.