Re: ARM cross-compiler with newlib, LTO, undefined reference to libc symbols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> With the arm cross compiler:
> /usr/libexec/gcc/arm-none-eabi/ld: /tmp/ccupVhtJ.ltrans0.ltrans.o: reference to malloc
> /usr/libexec/gcc/arm-none-eabi/ld: /tmp/ccupVhtJ.ltrans0.ltrans.o: in function `f':
> /home/gabriel/tmp/t1.c:3: undefined reference to `malloc'
> collect2: error: ld returned 1 exit status
> 
> So it's just not finding the symbol?

It's how static linking works: the defining object is not unpacked from libc.a
unless the linker previously saw a reference to it. The linker would need to
(re)scan libc.a after being handed this ltrans unit from the LTO plugin.

Can you show output with '-Wl,-v,-t', with and without LTO?

Alexander



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux