This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, RFC] Fix _bfd_elf_provide_symbols for weak imports


On Wed, Apr 27, 2005 at 08:35:39PM +0100, Julian Brown wrote:
> Julian Brown wrote:
> >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
> >
> 
> And now, with the patch.
> 
> Julian

> ? bfd/doc/bfd.info
> ? bfd/doc/bfd.info-1
> ? gas/doc/as.info
> ? gas/doc/as.info-1
> ? gprof/gprof.info
> ? gprof/gprof.info-1
> Index: bfd/elflink.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elflink.c,v
> retrieving revision 1.148
> diff -c -p -r1.148 elflink.c
> *** bfd/elflink.c	27 Apr 2005 10:09:43 -0000	1.148
> --- bfd/elflink.c	27 Apr 2005 19:01:52 -0000
> *************** _bfd_elf_provide_symbol (struct bfd_link
> *** 9808,9814 ****
>     struct elf_link_hash_entry *h;
>     h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE,
>   			    FALSE);
> !   if (h != NULL && h->root.type == bfd_link_hash_undefined)
>       {
>         h->root.type = bfd_link_hash_defined;
>         h->root.u.def.section = bfd_abs_section_ptr;
> --- 9808,9815 ----
>     struct elf_link_hash_entry *h;
>     h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE,
>   			    FALSE);
> !   if (h != NULL && (h->root.type == bfd_link_hash_undefined
> ! 	            || h->root.type == bfd_link_hash_undefweak))
>       {
>         h->root.type = bfd_link_hash_defined;
>         h->root.u.def.section = bfd_abs_section_ptr;

I think it is an obvious patch.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]