You are not logged in.

#1 2015-04-23 14:17:09

aarelovich
Member
Registered: 2015-04-23
Posts: 1

Error linking undefined reference to `__aeabi_idiv' when linking libgc

Hello,

I'm new to this forum. I need help and I thought this would be an appropiate place because of a couple of questions that directed me here. I apologize in advance if this is wrong.

I'm attempting to compile the dhrystone benchmark for an Cortex M0 processor.

This is my linker command:

arm-none-eabi-ld boot_and_link/startup.o drivers/gpio.o ../programs/dmips/dhry_1.o ../programs/dmips/dhry_2.o -nostartfiles -T boot_and_link/linker.ld -L/usr/lib/gcc/arm-none-eabi/4.8/armv6-m -lgcc -L/usr/lib/arm-none-eabi/newlib/armv6-m/ -lc -L/usr/lib/arm-none-eabi/newlib/armv6-m/ -lnosys -o ../programs/dmips/dmips.elf

I'm using, my own startup code and my own linker script since I'm doing a bare metal compilation in an attempt to run Dhrystone benchmark on an Cortex M0 processor.

These are the errors I get:

/usr/lib/arm-none-eabi/newlib/armv6-m//libc.a(lib_a-fvwrite.o): In function `__sfvwrite_r':
/home/tin/projects/debian/arm-toolchain/collab-maint/newlib/build/arm-none-eabi/armv6-m/newlib/libc/stdio/../../../../../../newlib/libc/stdio/fvwrite.c:196: undefined reference to `__aeabi_idiv'

/usr/lib/arm-none-eabi/newlib/armv6-m//libnosys.a(sbrk.o): In function `_sbrk':
/home/tin/projects/debian/arm-toolchain/collab-maint/newlib/build/arm-none-eabi/armv6-m/libgloss/libnosys/../../../../../libgloss/libnosys/sbrk.c:14: undefined reference to `end'

The end symbol, as I understand it, should be the end of the heap right? I can get rid of it by setting it in the linker script.

However the other one is wierd. That symbol is declared in libgcc.a which is included.

In my opinion the problem is a simple path conflict: whatever fvwrite.o is, it wants to use that symbol and the linker is not looking for it in libgcc.a which exists and is added as parameter library. Keep in mind this is just a thought. I don't really know what is going on.

I would appricate any insight and/or help.

Offline

Board footer

Powered by FluxBB