[PATCH, RFC] Fix _bfd_elf_provide_symbols for weak imports

Julian Brown julian@codesourcery.com
Wed Apr 27 19:58:00 GMT 2005


Hi,

This patch fixes running __libc_{init,fini}_array (for 
.{init,fini}_array sections) with Newlib. The symbols 
__init_array_{start,end} etc. are imported as weak in Newlib, which 
conflicts with (I think) this change to use 
gld${EMULATION_NAME}_provide_bound_symbols rather than a linker script, 
to provide such symbols:

   http://sources.redhat.com/ml/binutils/2005-03/msg00688.html

Without the patch, the symbols resolved to zero, which stops static 
object construction/destruction from working. This affects the current 
csl-arm-branch gcc (and also soon mainline for the ARM EABI target, with 
a patch that is currently blocked on this problem).

Tested on arm-none-eabi with cross and with all targets on 
i686-pc-linux-gnu.

OK to apply?

Julian

ChangeLog:

bfd/

   * elflink.c (_bfd_elf_provide_symbol): Provide symbol for weak import.



More information about the Binutils mailing list