This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] Providing init_fini_syms earlier?
- From: Michael Matz <matz at suse dot de>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: "H. J. Lu" <hjl at lucon dot org>, binutils at sources dot redhat dot com
- Date: Fri, 5 Aug 2005 09:53:09 +0200 (CEST)
- Subject: Re: [RFC] Providing init_fini_syms earlier?
- References: <20050711144500.GB31057@lucon.org> <20050711145106.GL5314@systemhalted.org><20050711174741.GA1456@lucon.org> <20050711180655.GN5314@systemhalted.org><20050711190623.GP4740@sunsite.mff.cuni.cz> <20050711212643.GA4707@lucon.org><20050712005740.GI30960@bubble.grove.modra.org> <20050713004712.GA27973@lucon.org><20050713133211.GN30960@bubble.grove.modra.org> <20050713134825.GO30960@bubble.grove.modra.org><20050714135406.GA28189@bubble.grove.modra.org> <Pine.LNX.4.58.0508050749200.15214@wotan.suse.de>
Hi,
On Fri, 5 Aug 2005, Michael Matz wrote:
> > bfd/
> > * bfd-in.h (_bfd_elf_fix_excluded_sec_syms): Declare.
> > (_bfd_elf_provide_section_bound_symbols): Remove param name.
> > Formatting.
> > * bfd-in2.h: Regenerate.
> > * elflink.c (bfd_elf_gc_sections): Don't call generic function.
> > (_bfd_elf_provide_symbol): Formatting.
> > (_bfd_elf_provide_section_bound_symbols): Remove all hacks, just
> > create section relative syms.
> > (fix_syms, _bfd_elf_fix_excluded_sec_syms): New functions.
>
> How I wish having more time following the binutils@ list. Then I would
> have noticed this earlier, so sorry. This patch which in one or the other
> form seems now to be in binutils breaks alpha again. The problem is, that
I must admit that I initially noticed the problem with HJs 2.16.91.0.2
binutils, but I now reproduced it with clean CVS binutils. I saw (in
passing) some later messages also dealing with these issues, so none of
these other patches fixed the problem. I used the below change to
work-around the issue.
Ciao,
Michael.
--
Index: elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.186
diff -u -p -r1.186 elflink.c
--- elflink.c 4 Aug 2005 01:19:03 -0000 1.186
+++ elflink.c 5 Aug 2005 07:46:48 -0000
@@ -9884,6 +9884,18 @@ _bfd_elf_provide_section_bound_symbols (
const char *end)
{
bfd_vma val = 0;
+ if (!sec)
+ {
+ /* We have to choose those values very carefully. Some targets,
+ like alpha, may have relocation overflow with 0. "__bss_start"
+ should be defined in all cases. */
+ struct elf_link_hash_entry *h
+ = elf_link_hash_lookup (elf_hash_table (info), "__bss_start",
+ FALSE, FALSE, FALSE);
+ if (h != NULL && h->root.type == bfd_link_hash_defined)
+ val = h->root.u.def.value;
+ }
+
_bfd_elf_provide_symbol (info, start, val, sec);
if (sec != NULL)
val = sec->size;