public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
@ 2002-02-28 14:38 Ulrich Drepper
  2002-02-28 16:58 ` H . J . Lu
  0 siblings, 1 reply; 18+ messages in thread
From: Ulrich Drepper @ 2002-02-28 14:38 UTC (permalink / raw)
  To: GNU libc hacker

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

Another mail from David.  He'll eventually manage to get the mailing
list handler to accept his machine.


[-- Attachment #2: Type: message/rfc822, Size: 1447 bytes --]

From: David Mosberger <davidm@hpl.hp.com>
To: <binutils@sources.redhat.com>
Cc: "David Mosberger" <davidm@hpl.hp.com>, Cary Coutant <cary@cup.hp.com>, <linux-ia64@linuxia64.org>, libc-hacker@sources.redhat.com
Subject: Re: [Linux-ia64] problem with unwind info for .init/.fini sections
Date: Thu, 28 Feb 2002 13:33:39 -0800
Message-ID: <15486.41523.514655.290242@napali.hpl.hp.com>

>>>>> On Wed, 27 Feb 2002 11:19:30 -0800, Cary Coutant <cary@cup.hp.com> said:

  >> I can think of two approaches:
  >> ...
  >> Anybody else have a better idea or other comments?

  Cary> (3) Use the .init_array and .fini_array sections instead.

This would be by far the cleanest solution.

How well is this supported in binutils at the moment?  I see some
references to it, but am not sure whether there are any holes in its
support.

Are there any reasons *not* to switch to .init_array/.fini_array as
the primary init/fini mechanism?  Besides fixing the unwind problem,
it seems to me it's generally just a much cleaner solution and should
allow us to get rid of some rather ugly hacks in glibc.

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-02-28 14:38 [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections Ulrich Drepper
@ 2002-02-28 16:58 ` H . J . Lu
  2002-02-28 17:19   ` David Mosberger
  0 siblings, 1 reply; 18+ messages in thread
From: H . J . Lu @ 2002-02-28 16:58 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: GNU libc hacker, binutils

On Thu, Feb 28, 2002 at 02:37:47PM -0800, Ulrich Drepper wrote:
> Another mail from David.  He'll eventually manage to get the mailing
> list handler to accept his machine.
> 

> From: David Mosberger <davidm@hpl.hp.com>
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Message-ID: <15486.41523.514655.290242@napali.hpl.hp.com>
> Date: Thu, 28 Feb 2002 13:33:39 -0800
> To: <binutils@sources.redhat.com>
> Cc: "David Mosberger" <davidm@hpl.hp.com>, Cary Coutant <cary@cup.hp.com>,
>         <linux-ia64@linuxia64.org>, libc-hacker@sources.redhat.com
> Subject: Re: [Linux-ia64] problem with unwind info for .init/.fini sections
> In-Reply-To: <200202271920.LAA10765@adlmail.cup.hp.com>
> References: <200202271920.LAA10765@adlmail.cup.hp.com>
> X-Mailer: VM 7.01 under Emacs 21.1.1
> Reply-To: davidm@hpl.hp.com
> X-URL: http://www.hpl.hp.com/personal/David_Mosberger/
> MIME-Version: 1.0
> 
> >>>>> On Wed, 27 Feb 2002 11:19:30 -0800, Cary Coutant <cary@cup.hp.com> said:
> 
>   >> I can think of two approaches:
>   >> ...
>   >> Anybody else have a better idea or other comments?
> 
>   Cary> (3) Use the .init_array and .fini_array sections instead.
> 
> This would be by far the cleanest solution.
> 
> How well is this supported in binutils at the moment?  I see some
> references to it, but am not sure whether there are any holes in its
> support.
> 
> Are there any reasons *not* to switch to .init_array/.fini_array as
> the primary init/fini mechanism?  Besides fixing the unwind problem,
> it seems to me it's generally just a much cleaner solution and should
> allow us to get rid of some rather ugly hacks in glibc.
> 
> 	--david

I am not sure if .init_array/.fini_array are supported. It will be nice
to add them to binutils. 


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-02-28 16:58 ` H . J . Lu
@ 2002-02-28 17:19   ` David Mosberger
  2002-02-28 17:28     ` Ulrich Drepper
  2002-02-28 17:33     ` H . J . Lu
  0 siblings, 2 replies; 18+ messages in thread
From: David Mosberger @ 2002-02-28 17:19 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Thu, 28 Feb 2002 16:58:52 -0800, "H . J . Lu" <hjl@lucon.org> said:

  HJ> I am not sure if .init_array/.fini_array are supported. It will
  HJ> be nice to add them to binutils.

From my point of view, it's more worthwhile to spend time on getting
.init_array/.fini_array supported than trying to fix up .init/.fini.
I'm willing to help with such an effort, but I probably would need a
fair amount of help (or at least support) from the glibc and binutils
maintainers.  Anyone else willing to help with this?

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-02-28 17:19   ` David Mosberger
@ 2002-02-28 17:28     ` Ulrich Drepper
  2002-02-28 17:33     ` H . J . Lu
  1 sibling, 0 replies; 18+ messages in thread
From: Ulrich Drepper @ 2002-02-28 17:28 UTC (permalink / raw)
  To: davidm; +Cc: H . J . Lu, GNU libc hacker, binutils

David Mosberger <davidm@napali.hpl.hp.com> writes:

> but I probably would need a fair amount of help (or at least
> support) from the glibc and binutils maintainers.  Anyone else
> willing to help with this?

There should be nothing to be done in glibc.  Support is included for
ages.  Not tested, of course, put it's there.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-02-28 17:19   ` David Mosberger
  2002-02-28 17:28     ` Ulrich Drepper
@ 2002-02-28 17:33     ` H . J . Lu
  2002-02-28 17:43       ` David Mosberger
  1 sibling, 1 reply; 18+ messages in thread
From: H . J . Lu @ 2002-02-28 17:33 UTC (permalink / raw)
  To: davidm; +Cc: Ulrich Drepper, GNU libc hacker, binutils

On Thu, Feb 28, 2002 at 05:19:35PM -0800, David Mosberger wrote:
> >>>>> On Thu, 28 Feb 2002 16:58:52 -0800, "H . J . Lu" <hjl@lucon.org> said:
> 
>   HJ> I am not sure if .init_array/.fini_array are supported. It will
>   HJ> be nice to add them to binutils.
> 
> >From my point of view, it's more worthwhile to spend time on getting
> .init_array/.fini_array supported than trying to fix up .init/.fini.
> I'm willing to help with such an effort, but I probably would need a
> fair amount of help (or at least support) from the glibc and binutils
> maintainers.  Anyone else willing to help with this?
> 

I believe glibc is ok. The problem is binutils. I didn't see any
supports for DT_INIT_ARRAY, DT_FINI_ARRAY. DT_INIT_ARRAYSZ,
DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY nor DT_PREINIT_ARRAYSZ.


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-02-28 17:33     ` H . J . Lu
@ 2002-02-28 17:43       ` David Mosberger
       [not found]         ` <20020228175426.A30756@redhat.com>
  0 siblings, 1 reply; 18+ messages in thread
From: David Mosberger @ 2002-02-28 17:43 UTC (permalink / raw)
  To: H . J . Lu; +Cc: davidm, Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Thu, 28 Feb 2002 17:33:11 -0800, "H . J . Lu" <hjl@lucon.org> said:

  HJ> I believe glibc is ok. The problem is binutils. I didn't see any
  HJ> supports for DT_INIT_ARRAY, DT_FINI_ARRAY. DT_INIT_ARRAYSZ,
  HJ> DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY nor DT_PREINIT_ARRAYSZ.

Shouldn't this be easy straight-forward to add?

I guess the other component that needs updating is gcc (at least the
ia64 versions of crtbegin.asm and crtend.asm would need that).  I'd be
happy to work on this.

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]         ` <20020228175426.A30756@redhat.com>
@ 2002-02-28 18:01           ` David Mosberger
  2002-02-28 18:11           ` H . J . Lu
  2002-02-28 22:42           ` David Mosberger
  2 siblings, 0 replies; 18+ messages in thread
From: David Mosberger @ 2002-02-28 18:01 UTC (permalink / raw)
  To: Richard Henderson
  Cc: davidm, H . J . Lu, Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Thu, 28 Feb 2002 17:54:26 -0800, Richard Henderson <rth@redhat.com> said:

  Rich> Yes, it should.  I think there's even some code for this for
  Rich> ia64-hpux in the tree already.

I only see code to print the DT*ARRAY* tags and to recognize the respective
sections.  Looks to me like elflink.h needs to be updated?

  >> I guess the other component that needs updating is gcc (at least
  >> the ia64 versions of crtbegin.asm and crtend.asm would need
  >> that).  I'd be happy to work on this.

  Rich> Should be easy too, except for the bit to figure out whether
  Rich> or not support for this exists in ld.so.

Right.

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]         ` <20020228175426.A30756@redhat.com>
  2002-02-28 18:01           ` David Mosberger
@ 2002-02-28 18:11           ` H . J . Lu
  2002-02-28 22:42           ` David Mosberger
  2 siblings, 0 replies; 18+ messages in thread
From: H . J . Lu @ 2002-02-28 18:11 UTC (permalink / raw)
  To: Richard Henderson; +Cc: davidm, Ulrich Drepper, GNU libc hacker, binutils

On Thu, Feb 28, 2002 at 05:54:26PM -0800, Richard Henderson wrote:
> 
> > I guess the other component that needs updating is gcc (at least the
> > ia64 versions of crtbegin.asm and crtend.asm would need that).  I'd be
> > happy to work on this.
> 
> Should be easy too, except for the bit to figure out whether or
> not support for this exists in ld.so.

ld should only generate those DT_XXX_ARRAY entries from those
.xxx_array sections. If ld.so doesn't support DT_XXX_ARRAY, there
shouldn't be any .xxx_array sections in ld inputs. It it is not an
ld problem. I think gcc should check it.


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]         ` <20020228175426.A30756@redhat.com>
  2002-02-28 18:01           ` David Mosberger
  2002-02-28 18:11           ` H . J . Lu
@ 2002-02-28 22:42           ` David Mosberger
       [not found]             ` <20020228225757.A30933@redhat.com>
  2 siblings, 1 reply; 18+ messages in thread
From: David Mosberger @ 2002-02-28 22:42 UTC (permalink / raw)
  To: Richard Henderson
  Cc: davidm, H . J . Lu, Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Thu, 28 Feb 2002 17:54:26 -0800, Richard Henderson <rth@redhat.com> said:

  Rich> On Thu, Feb 28, 2002 at 05:43:07PM -0800, David Mosberger
  Rich> wrote:

  HJ> I believe glibc is ok. The problem is binutils. I didn't see any
  HJ> supports for DT_INIT_ARRAY, DT_FINI_ARRAY. DT_INIT_ARRAYSZ,
  HJ> DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY nor DT_PREINIT_ARRAYSZ.

  David>  Shouldn't this be easy straight-forward to add?

  Rich> Yes, it should.  I think there's even some code for this for
  Rich> ia64-hpux in the tree already.

OK, how is the attached for a start?

I'm not sure it's 100% correct, so it needs some reviewing, but it
does seem to do the right thing.

There is one more problem in glibc however: each platform's startup
code needs to be modified to handle these sections (since the dynamic
loader doesn't call them; which makes sense given that we need to
handle static binaries at any rate).  But how can the startup code
find to these sections?  Perhaps we should define symbols in the
linker script to mark the beginning and end of each section?  (I don't
know what the ${RELOCATING+${INIT_ARRAY_START}} stuff means in
scripttempl/elf.sc; perhaps this does the right thing?)

Thanks,

	--david

-----------------------
bfd/ChangeLog:

2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* elflink.h (size_dynamic_sections): If section named
	".preinit_array" exists, create DT_PREINIT_ARRAY and
	DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
	".init_array" and ".fini_array".
	(elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
	DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
	DT_FINI_ARRAY.

ld/ChangeLog:

2001-04-18  David Mosberger  <davidm@hpl.hp.com>

	* emulparams/elf64_ia64.sh (EXECUTABLE_SYMBOLS): Provide default
	value for _FPU_STATUS (initial value of ar.fpsr).



Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.141
diff -u -r1.141 elflink.h
--- bfd/elflink.h	2002/01/21 10:29:07	1.141
+++ bfd/elflink.h	2002/03/01 06:26:19
@@ -3200,6 +3200,33 @@
 	    return false;
 	}
 
+      /* yuck, more matching by name... */
+
+      if (bfd_get_section_by_name (output_bfd, ".preinit_array"))
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (bfd_get_section_by_name (output_bfd, ".init_array"))
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (bfd_get_section_by_name (output_bfd, ".fini_array"))
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+
       dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
       /* If .dynstr is excluded from the link, we don't want any of
 	 these tags.  Strictly, we should be checking each section
@@ -5548,6 +5575,31 @@
 		  }
 	      }
 	      break;
+
+	    case DT_PREINIT_ARRAYSZ:
+	      name = ".preinit_array";
+	      goto get_size;
+	    case DT_INIT_ARRAYSZ:
+	      name = ".init_array";
+	      goto get_size;
+	    case DT_FINI_ARRAYSZ:
+	      name = ".fini_array";
+	    get_size:
+	      o = bfd_get_section_by_name (abfd, name);
+	      BFD_ASSERT (o != NULL);
+	      dyn.d_un.d_val = o->_raw_size;
+	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
+	      break;
+
+	    case DT_PREINIT_ARRAY:
+	      name = ".preinit_array";
+	      goto get_vma;
+	    case DT_INIT_ARRAY:
+	      name = ".init_array";
+	      goto get_vma;
+	    case DT_FINI_ARRAY:
+	      name = ".fini_array";
+	      goto get_vma;
 
 	    case DT_HASH:
 	      name = ".hash";

Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.26
diff -u -r1.26 elf.sc
--- ld/scripttempl/elf.sc	2002/02/12 14:50:08	1.26
+++ ld/scripttempl/elf.sc	2002/03/01 06:26:29
@@ -246,6 +246,27 @@
     ${RELOCATING+${INIT_END}}
   } =${NOP-0}
 
+  .preinit_array   ${RELOCATING-0} :
+  {
+    ${RELOCATING+${PREINIT_ARRAY_START}}
+    KEEP (*(.preinit_array))
+    ${RELOCATING+${PREINIT_ARRAY_END}}
+  }
+
+  .init_array   ${RELOCATING-0} :
+  {
+    ${RELOCATING+${INIT_ARRAY_START}}
+    KEEP (*(.init_array))
+    ${RELOCATING+${INIT_ARRAY_END}}
+  }
+
+  .fini_array   ${RELOCATING-0} :
+  {
+    ${RELOCATING+${FINI_ARRAY_START}}
+    KEEP (*(.fini_array))
+    ${RELOCATING+${FINI_ARRAY_END}}
+  }
+
   ${DATA_PLT-${BSS_PLT-${PLT}}}
   .text         ${RELOCATING-0} :
   {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]             ` <20020228225757.A30933@redhat.com>
@ 2002-03-01 10:24               ` David Mosberger
       [not found]                 ` <20020301164725.C31581@redhat.com>
  2002-03-02  0:36                 ` H . J . Lu
  0 siblings, 2 replies; 18+ messages in thread
From: David Mosberger @ 2002-03-01 10:24 UTC (permalink / raw)
  To: Richard Henderson
  Cc: davidm, H . J . Lu, Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Thu, 28 Feb 2002 22:57:57 -0800, Richard Henderson <rth@redhat.com> said:

  Richard> On Thu, Feb 28, 2002 at 10:41:51PM -0800, David Mosberger
  Richard> wrote:
  >> (I don't know what the ${RELOCATING+${INIT_ARRAY_START}} stuff
  >> means in scripttempl/elf.sc; perhaps this does the right thing?)

  Richard> It's sh code.  If RELOCATING is set, then expand
  Richard> INIT_ARRAY_START.  Which you havn't defined to anything, so
  Richard> it's of course empty.

  Richard> You'd want to do something like

  Richard> 	INIT_ARRAY_START="PROVIDE(__init_array_start = .)"
  Richard> ${RELOCATING+${CREATE_SHLIB-${INIT_ARRAY_START}}}

OK, so how about this patch?

With this version, the linker determines whether a DT_*_ARRAY is
needed by search the input bfds for sections with the magic name.
Is there a better way for doing such a check?

	--david

--- bfd/ChangeLog	2002/02/22 20:36:12	1.1363
2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* elflink.h (size_dynamic_sections): If section named
	".preinit_array" exists, create DT_PREINIT_ARRAY and
	DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
	".init_array" and ".fini_array".
	(elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
	DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
	DT_FINI_ARRAY.

--- ld/ChangeLog
2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
	.init_array, and .fini_array.

Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.141
diff -u -r1.141 elflink.h
--- bfd/elflink.h	2002/01/21 10:29:07	1.141
+++ bfd/elflink.h	2002/03/01 17:29:46
@@ -3029,7 +3029,9 @@
      struct bfd_elf_version_tree *verdefs;
 {
   bfd_size_type soname_indx;
-  bfd *dynobj;
+  bfd *dynobj, *sub;
+  asection *o;
+  int need_preinit_array = 0, need_init_array = 0, need_fini_array = 0;
   struct elf_backend_data *bed;
   struct elf_assign_sym_version_info asvinfo;
 
@@ -3200,6 +3202,43 @@
 	    return false;
 	}
 
+      for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+	for (o = sub->sections; o != NULL; o = o->next)
+	  {
+	    /* yuck, more matching by name... */
+
+	    if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
+	      need_preinit_array = 1;
+	    if (strcmp (bfd_section_name (sub, o), ".init_array") == 0)
+	      need_init_array = 1;
+	    if (strcmp (bfd_section_name (sub, o), ".fini_array") == 0)
+	      need_fini_array = 1;
+	  }
+      if (need_preinit_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (need_init_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (need_fini_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+
       dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
       /* If .dynstr is excluded from the link, we don't want any of
 	 these tags.  Strictly, we should be checking each section
@@ -5548,6 +5587,31 @@
 		  }
 	      }
 	      break;
+
+	    case DT_PREINIT_ARRAYSZ:
+	      name = ".preinit_array";
+	      goto get_size;
+	    case DT_INIT_ARRAYSZ:
+	      name = ".init_array";
+	      goto get_size;
+	    case DT_FINI_ARRAYSZ:
+	      name = ".fini_array";
+	    get_size:
+	      o = bfd_get_section_by_name (abfd, name);
+	      BFD_ASSERT (o != NULL);
+	      dyn.d_un.d_val = o->_raw_size;
+	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
+	      break;
+
+	    case DT_PREINIT_ARRAY:
+	      name = ".preinit_array";
+	      goto get_vma;
+	    case DT_INIT_ARRAY:
+	      name = ".init_array";
+	      goto get_vma;
+	    case DT_FINI_ARRAY:
+	      name = ".fini_array";
+	      goto get_vma;
 
 	    case DT_HASH:
 	      name = ".hash";
Index: scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.26
diff -u -r1.26 elf.sc
--- scripttempl/elf.sc	2002/02/12 14:50:08	1.26
+++ scripttempl/elf.sc	2002/03/01 18:23:50
@@ -246,6 +246,18 @@
     ${RELOCATING+${INIT_END}}
   } =${NOP-0}
 
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
+  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .)}};
+  .init_array   ${RELOCATING-0} : { *(.init_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
+  .fini_array   ${RELOCATING-0} : { *(.fini_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+
   ${DATA_PLT-${BSS_PLT-${PLT}}}
   .text         ${RELOCATING-0} :
   {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]                 ` <20020301164725.C31581@redhat.com>
@ 2002-03-01 16:56                   ` David Mosberger
       [not found]                     ` <20020301170010.A31610@redhat.com>
  0 siblings, 1 reply; 18+ messages in thread
From: David Mosberger @ 2002-03-01 16:56 UTC (permalink / raw)
  To: Richard Henderson
  Cc: davidm, H . J . Lu, Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Fri, 1 Mar 2002 16:47:25 -0800, Richard Henderson <rth@redhat.com> said:

  Richard> On Fri, Mar 01, 2002 at 10:24:26AM -0800, David Mosberger wrote:
  >> OK, so how about this patch?

  Richard> Looks close.

Great!

  Richard> The only problem I see is with

  >> +  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
  >> +  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
  >> +  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}

  Richard> Suppose . is not as aligned as the contents of .preinit_array
  Richard> etc?  Then __preinit_array_start will have the wrong value.
  Richard> I think you want

  Richard> .preinit_array ${RELOCATING-0} : ${RELOCATING+ALIGN(${ALIGNMENT})} {
  Richard> ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
  Richard> *(.preinit_array)
  Richard> ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
  Richard> }

  Richard> That will make sure you get 4 byte alignment for ELF32 and 8 byte
  Richard> alignment for ELF64.  And assuming that the sections are similarly
  Richard> aligned, this should work fine.

Good point.  The reason I moved the labels outside is because
otherwise the linker seems to insist on creating the sections, even if
they're empty.  Is there another way to avoid this?  If not, I suppose
we can live with that as it's more of a beauty blemish than a real
problem.

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]                     ` <20020301170010.A31610@redhat.com>
@ 2002-03-01 17:20                       ` David Mosberger
       [not found]                         ` <20020301172558.A31648@redhat.com>
  0 siblings, 1 reply; 18+ messages in thread
From: David Mosberger @ 2002-03-01 17:20 UTC (permalink / raw)
  To: Richard Henderson; +Cc: H . J . Lu, Ulrich Drepper, GNU libc hacker, binutils

>>>>> On Fri, 1 Mar 2002 17:00:10 -0800, Richard Henderson <rth@redhat.com> said:

  Richard> On Fri, Mar 01, 2002 at 04:52:55PM -0800, David Mosberger wrote:
  >> The reason I moved the labels outside is because
  >> otherwise the linker seems to insist on creating the sections, even if
  >> they're empty.  Is there another way to avoid this?

  Richard> Not that I'm aware of.  I suppose you could put

  Richard> ${RELOCATING+. = ALIGN(${ALIGNMENT})}

  Richard> before the first label, which should have the same effect.

OK, that's what I did.  Could this be applied to the relevant branches?

Thanks,

	--david

---
bfd/ChangeLog:

2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* elflink.h (size_dynamic_sections): If section named
	".preinit_array" exists, create DT_PREINIT_ARRAY and
	DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
	".init_array" and ".fini_array".
	(elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
	DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
	DT_FINI_ARRAY.

---
ld/ChangeLog

2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
	.init_array, and .fini_array.

Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.141
diff -u -r1.141 elflink.h
--- bfd/elflink.h	2002/01/21 10:29:07	1.141
+++ bfd/elflink.h	2002/03/02 01:12:38
@@ -3029,7 +3029,9 @@
      struct bfd_elf_version_tree *verdefs;
 {
   bfd_size_type soname_indx;
-  bfd *dynobj;
+  bfd *dynobj, *sub;
+  asection *o;
+  int need_preinit_array = 0, need_init_array = 0, need_fini_array = 0;
   struct elf_backend_data *bed;
   struct elf_assign_sym_version_info asvinfo;
 
@@ -3200,6 +3202,43 @@
 	    return false;
 	}
 
+      for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+	for (o = sub->sections; o != NULL; o = o->next)
+	  {
+	    /* yuck, more matching by name... */
+
+	    if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
+	      need_preinit_array = 1;
+	    if (strcmp (bfd_section_name (sub, o), ".init_array") == 0)
+	      need_init_array = 1;
+	    if (strcmp (bfd_section_name (sub, o), ".fini_array") == 0)
+	      need_fini_array = 1;
+	  }
+      if (need_preinit_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (need_init_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (need_fini_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+
       dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
       /* If .dynstr is excluded from the link, we don't want any of
 	 these tags.  Strictly, we should be checking each section
@@ -5548,6 +5587,31 @@
 		  }
 	      }
 	      break;
+
+	    case DT_PREINIT_ARRAYSZ:
+	      name = ".preinit_array";
+	      goto get_size;
+	    case DT_INIT_ARRAYSZ:
+	      name = ".init_array";
+	      goto get_size;
+	    case DT_FINI_ARRAYSZ:
+	      name = ".fini_array";
+	    get_size:
+	      o = bfd_get_section_by_name (abfd, name);
+	      BFD_ASSERT (o != NULL);
+	      dyn.d_un.d_val = o->_raw_size;
+	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
+	      break;
+
+	    case DT_PREINIT_ARRAY:
+	      name = ".preinit_array";
+	      goto get_vma;
+	    case DT_INIT_ARRAY:
+	      name = ".init_array";
+	      goto get_vma;
+	    case DT_FINI_ARRAY:
+	      name = ".fini_array";
+	      goto get_vma;
 
 	    case DT_HASH:
 	      name = ".hash";
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.26
diff -u -r1.26 elf.sc
--- ld/scripttempl/elf.sc	2002/02/12 14:50:08	1.26
+++ ld/scripttempl/elf.sc	2002/03/02 01:12:39
@@ -246,6 +246,23 @@
     ${RELOCATING+${INIT_END}}
   } =${NOP-0}
 
+  /* Ensure the __preinit_array_start label is properly aligned.  We
+     could instead move the label definition inside the section, but
+     the linker would then create the section even if it turns out to
+     be empty, which isn't pretty.  */
+  ${RELOCATING+. = ALIGN(${ALIGNMENT})}
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
+  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .)}};
+  .init_array   ${RELOCATING-0} : { *(.init_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
+  .fini_array   ${RELOCATING-0} : { *(.fini_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+
   ${DATA_PLT-${BSS_PLT-${PLT}}}
   .text         ${RELOCATING-0} :
   {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]                         ` <20020301172558.A31648@redhat.com>
@ 2002-03-01 17:36                           ` David Mosberger
  0 siblings, 0 replies; 18+ messages in thread
From: David Mosberger @ 2002-03-01 17:36 UTC (permalink / raw)
  To: Richard Henderson, drow; +Cc: GNU libc hacker, binutils

>>>>> On Fri, 1 Mar 2002 17:25:58 -0800, Richard Henderson <rth@redhat.com> said:

  Rich> On Fri, Mar 01, 2002 at 05:16:12PM -0800, David Mosberger wrote:
  >> OK, that's what I did.  Could this be applied to the relevant branches?

  Rich> Applied to mainline.

Thanks!


  Rich> IIRC, the 2.12 branch is closed.

Daniel, are you overseeing the 2.12 branch?  If so, any chance to make
an exception for this change?  My hope is the patch is trivial enough
to be considered safe and it would certainly help getting the
remaining unwind-related bugs ironed out of ia64 linux.  It should
also help freebsd/ia64 to get this right from the start.

	--david

---
bfd/ChangeLog:

2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* elflink.h (size_dynamic_sections): If section named
	".preinit_array" exists, create DT_PREINIT_ARRAY and
	DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
	".init_array" and ".fini_array".
	(elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
	DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
	DT_FINI_ARRAY.

---
ld/ChangeLog

2002-02-28  David Mosberger  <davidm@hpl.hp.com>

	* scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,
	.init_array, and .fini_array.

Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.141
diff -u -r1.141 elflink.h
--- bfd/elflink.h	2002/01/21 10:29:07	1.141
+++ bfd/elflink.h	2002/03/02 01:12:38
@@ -3029,7 +3029,9 @@
      struct bfd_elf_version_tree *verdefs;
 {
   bfd_size_type soname_indx;
-  bfd *dynobj;
+  bfd *dynobj, *sub;
+  asection *o;
+  int need_preinit_array = 0, need_init_array = 0, need_fini_array = 0;
   struct elf_backend_data *bed;
   struct elf_assign_sym_version_info asvinfo;
 
@@ -3200,6 +3202,43 @@
 	    return false;
 	}
 
+      for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+	for (o = sub->sections; o != NULL; o = o->next)
+	  {
+	    /* yuck, more matching by name... */
+
+	    if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
+	      need_preinit_array = 1;
+	    if (strcmp (bfd_section_name (sub, o), ".init_array") == 0)
+	      need_init_array = 1;
+	    if (strcmp (bfd_section_name (sub, o), ".fini_array") == 0)
+	      need_fini_array = 1;
+	  }
+      if (need_preinit_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (need_init_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+      if (need_fini_array)
+	{
+	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAY,
+				      (bfd_vma) 0)
+	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAYSZ,
+					 (bfd_vma) 0))
+	    return false;
+	}
+
       dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
       /* If .dynstr is excluded from the link, we don't want any of
 	 these tags.  Strictly, we should be checking each section
@@ -5548,6 +5587,31 @@
 		  }
 	      }
 	      break;
+
+	    case DT_PREINIT_ARRAYSZ:
+	      name = ".preinit_array";
+	      goto get_size;
+	    case DT_INIT_ARRAYSZ:
+	      name = ".init_array";
+	      goto get_size;
+	    case DT_FINI_ARRAYSZ:
+	      name = ".fini_array";
+	    get_size:
+	      o = bfd_get_section_by_name (abfd, name);
+	      BFD_ASSERT (o != NULL);
+	      dyn.d_un.d_val = o->_raw_size;
+	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
+	      break;
+
+	    case DT_PREINIT_ARRAY:
+	      name = ".preinit_array";
+	      goto get_vma;
+	    case DT_INIT_ARRAY:
+	      name = ".init_array";
+	      goto get_vma;
+	    case DT_FINI_ARRAY:
+	      name = ".fini_array";
+	      goto get_vma;
 
 	    case DT_HASH:
 	      name = ".hash";
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.26
diff -u -r1.26 elf.sc
--- ld/scripttempl/elf.sc	2002/02/12 14:50:08	1.26
+++ ld/scripttempl/elf.sc	2002/03/02 01:12:39
@@ -246,6 +246,23 @@
     ${RELOCATING+${INIT_END}}
   } =${NOP-0}
 
+  /* Ensure the __preinit_array_start label is properly aligned.  We
+     could instead move the label definition inside the section, but
+     the linker would then create the section even if it turns out to
+     be empty, which isn't pretty.  */
+  ${RELOCATING+. = ALIGN(${ALIGNMENT})}
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
+  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .)}};
+  .init_array   ${RELOCATING-0} : { *(.init_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
+  .fini_array   ${RELOCATING-0} : { *(.fini_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+
   ${DATA_PLT-${BSS_PLT-${PLT}}}
   .text         ${RELOCATING-0} :
   {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-03-01 10:24               ` David Mosberger
       [not found]                 ` <20020301164725.C31581@redhat.com>
@ 2002-03-02  0:36                 ` H . J . Lu
       [not found]                   ` <20020302101931.GM1059@bubble.sa.bigpond.net.au>
  1 sibling, 1 reply; 18+ messages in thread
From: H . J . Lu @ 2002-03-02  0:36 UTC (permalink / raw)
  To: davidm; +Cc: Richard Henderson, Ulrich Drepper, GNU libc hacker, binutils

On Fri, Mar 01, 2002 at 10:24:26AM -0800, David Mosberger wrote:
> >>>>> On Thu, 28 Feb 2002 22:57:57 -0800, Richard Henderson <rth@redhat.com> said:
> 
>   Richard> On Thu, Feb 28, 2002 at 10:41:51PM -0800, David Mosberger
>   Richard> wrote:
>   >> (I don't know what the ${RELOCATING+${INIT_ARRAY_START}} stuff
>   >> means in scripttempl/elf.sc; perhaps this does the right thing?)
> 
>   Richard> It's sh code.  If RELOCATING is set, then expand
>   Richard> INIT_ARRAY_START.  Which you havn't defined to anything, so
>   Richard> it's of course empty.
> 
>   Richard> You'd want to do something like
> 
>   Richard> 	INIT_ARRAY_START="PROVIDE(__init_array_start = .)"
>   Richard> ${RELOCATING+${CREATE_SHLIB-${INIT_ARRAY_START}}}
> 
> OK, so how about this patch?
> 
> With this version, the linker determines whether a DT_*_ARRAY is
> needed by search the input bfds for sections with the magic name.
> Is there a better way for doing such a check?
> 

.init_array, .fini_array and .preinit_array are new special sections.
We need to make sure their types and attributes are correct. Here is
a patch.


H.J.
----
2002-03-02  H.J. Lu <hjl@gnu.org>

	* elf.c (elf_fake_sections): Handle special sections,
	.init_array, .fini_array and .preinit_array.

	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check the
	section types instead of names for .init_array, .fini_array and
	.preinit_array.

2002-03-02  H.J. Lu <hjl@gnu.org>

	* config/obj-elf.c (special_section): Add .init_array,
	.fini_array and .preinit_array.

	* config/tc-ia64.h (ELF_TC_SPECIAL_SECTIONS): Remove
	.init_array and .fini_array.

--- binutils/bfd/elf.c.array	Tue Feb 19 15:17:40 2002
+++ binutils/bfd/elf.c	Sat Mar  2 00:25:51 2002
@@ -2178,6 +2178,12 @@ elf_fake_sections (abfd, asect, failedpt
       this_hdr->sh_type = SHT_REL;
       this_hdr->sh_entsize = bed->s->sizeof_rel;
     }
+  else if (strcmp (asect->name, ".init_array") == 0)
+    this_hdr->sh_type = SHT_INIT_ARRAY;
+  else if (strcmp (asect->name, ".fini_array") == 0)
+    this_hdr->sh_type = SHT_FINI_ARRAY;
+  else if (strcmp (asect->name, ".preinit_array") == 0)
+    this_hdr->sh_type = SHT_PREINIT_ARRAY;
   else if (strncmp (asect->name, ".note", 5) == 0)
     this_hdr->sh_type = SHT_NOTE;
   else if (strncmp (asect->name, ".stab", 5) == 0
--- binutils/bfd/elflink.h.array	Fri Mar  1 23:44:22 2002
+++ binutils/bfd/elflink.h	Sat Mar  2 00:22:26 2002
@@ -3200,6 +3200,7 @@ NAME(bfd_elf,size_dynamic_sections) (out
   bfd *dynobj, *sub;
   asection *o;
   int need_preinit_array = 0, need_init_array = 0, need_fini_array = 0;
+  int initfini_array = 0;
   struct elf_backend_data *bed;
   struct elf_assign_sym_version_info asvinfo;
 
@@ -3370,18 +3371,27 @@ NAME(bfd_elf,size_dynamic_sections) (out
 	    return false;
 	}
 
-      for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
-	for (o = sub->sections; o != NULL; o = o->next)
-	  {
-	    /* yuck, more matching by name... */
-
-	    if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
+      for (sub = info->input_bfds; sub != NULL && initfini_array != 3;
+	   sub = sub->link_next)
+	for (o = sub->sections; o != NULL && initfini_array != 3;
+	     o = o->next)
+	  switch (elf_section_data (o->output_section)->this_hdr.sh_type)
+	    {
+	    case SHT_PREINIT_ARRAY:
 	      need_preinit_array = 1;
-	    if (strcmp (bfd_section_name (sub, o), ".init_array") == 0)
+	      initfini_array++;
+	      break;
+	    case SHT_INIT_ARRAY:
 	      need_init_array = 1;
-	    if (strcmp (bfd_section_name (sub, o), ".fini_array") == 0)
+	      initfini_array++;
+	      break;
+	    case SHT_FINI_ARRAY:
 	      need_fini_array = 1;
-	  }
+	      initfini_array++;
+	      break;
+	    default:
+	      break;
+	    }
       if (need_preinit_array)
 	{
 	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY,
--- binutils/gas/config/obj-elf.c.array	Fri Mar  1 23:44:32 2002
+++ binutils/gas/config/obj-elf.c	Sat Mar  2 00:10:52 2002
@@ -595,6 +595,9 @@ static struct special_section const spec
   { ".rodata",	SHT_PROGBITS,	SHF_ALLOC			},
   { ".rodata1",	SHT_PROGBITS,	SHF_ALLOC			},
   { ".text",	SHT_PROGBITS,	SHF_ALLOC + SHF_EXECINSTR	},
+  { ".init_array",SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE         }, 
+  { ".fini_array",SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE         },
+  { ".preinit_array",SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE   }, 
 
 #ifdef ELF_TC_SPECIAL_SECTIONS
   ELF_TC_SPECIAL_SECTIONS
--- binutils/gas/config/tc-ia64.h.array	Tue Jan 15 11:30:50 2002
+++ binutils/gas/config/tc-ia64.h	Sat Mar  2 00:10:52 2002
@@ -124,8 +124,6 @@ extern void ia64_after_parse_args PARAMS
 #define WORKING_DOT_WORD	/* don't do broken word processing for now */
 
 #define ELF_TC_SPECIAL_SECTIONS						   \
-{ ".init_array",SHT_INIT_ARRAY,	SHF_ALLOC + SHF_WRITE                   }, \
-{ ".fini_array",SHT_FINI_ARRAY,	SHF_ALLOC + SHF_WRITE                   }, \
 { ".sbss",	SHT_NOBITS,	SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, \
 { ".sdata",	SHT_PROGBITS,	SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
       [not found]                   ` <20020302101931.GM1059@bubble.sa.bigpond.net.au>
@ 2002-03-02  9:24                     ` David Mosberger
  2002-03-02 10:59                       ` H . J . Lu
  0 siblings, 1 reply; 18+ messages in thread
From: David Mosberger @ 2002-03-02  9:24 UTC (permalink / raw)
  To: Alan Modra
  Cc: H . J . Lu, davidm, Richard Henderson, Ulrich Drepper,
	GNU libc hacker, binutils

>>>>> On Sat, 2 Mar 2002 20:49:31 +1030, Alan Modra <amodra@bigpond.net.au> said:

  Alan> On Sat, Mar 02, 2002 at 12:36:45AM -0800, H . J . Lu wrote:
  >>  .init_array, .fini_array and .preinit_array are new special
  >> sections.  We need to make sure their types and attributes are
  >> correct. Here is a patch.

  Alan> I like this, but there is a mistake in the following

  >> @@ -3370,18 +3371,27 @@ NAME(bfd_elf,size_dynamic_sections) (out
  >> return false; }
  >> 
  >> - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
  >> - for (o = sub->sections; o != NULL; o = o->next) - { - /* yuck,
  >> more matching by name... */
  >> -
  >> - if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
  >> + for (sub = info->input_bfds; sub != NULL && initfini_array !=
  >> 3; + sub = sub->link_next) + for (o = sub->sections; o != NULL &&
  >> initfini_array != 3; + o = o->next) + switch (elf_section_data
  >> (o->output_section)->this_hdr.sh_type) + { + case
  >> SHT_PREINIT_ARRAY: need_preinit_array = 1; - if (strcmp
  >> (bfd_section_name (sub, o), ".init_array") == 0) +
  >> initfini_array++;

  Alan> Presumably, initfini_array is trying to cut short the section
  Alan> search after finding one of each of the section types.  I
  Alan> can't see anything in the ELF spec that precludes having, say,
  Alan> three SHT_PREINIT_ARRAY input sections.  Best get rid of
  Alan> initfini_array entirely.

The loop really only needs to determine whether any _input_ sections
contain the preinit/init/fini arrays.  You could use a bitmask and
stop the search as soon as all three array sections have occurred at
least once.

I considered doing that but opted not to do so for clarity and because
I wasn't sure how often preinit arrays will be used: if it turns out
that most executables do not use preinit arrays, then the optimization
won't be very useful.

  Alan> The other thing is that you'll need to extend your patch a
  Alan> little to handle these section types in bfd_section_from_shdr.

Also, note that elfxx-ia64.c already has code to set the section
types.  It's good if this can be moved to elf.c, but there is no point
in keeping two copies of this code.

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-03-02  9:24                     ` David Mosberger
@ 2002-03-02 10:59                       ` H . J . Lu
  2002-03-02 11:13                         ` David Mosberger
  0 siblings, 1 reply; 18+ messages in thread
From: H . J . Lu @ 2002-03-02 10:59 UTC (permalink / raw)
  To: davidm
  Cc: Alan Modra, Richard Henderson, Ulrich Drepper, GNU libc hacker, binutils

On Sat, Mar 02, 2002 at 09:19:16AM -0800, David Mosberger wrote:
> >>>>> On Sat, 2 Mar 2002 20:49:31 +1030, Alan Modra <amodra@bigpond.net.au> said:
> 
>   Alan> On Sat, Mar 02, 2002 at 12:36:45AM -0800, H . J . Lu wrote:
>   >>  .init_array, .fini_array and .preinit_array are new special
>   >> sections.  We need to make sure their types and attributes are
>   >> correct. Here is a patch.
> 
>   Alan> I like this, but there is a mistake in the following
> 
>   >> @@ -3370,18 +3371,27 @@ NAME(bfd_elf,size_dynamic_sections) (out
>   >> return false; }
>   >> 
>   >> - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
>   >> - for (o = sub->sections; o != NULL; o = o->next) - { - /* yuck,
>   >> more matching by name... */
>   >> -
>   >> - if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
>   >> + for (sub = info->input_bfds; sub != NULL && initfini_array !=
>   >> 3; + sub = sub->link_next) + for (o = sub->sections; o != NULL &&
>   >> initfini_array != 3; + o = o->next) + switch (elf_section_data
>   >> (o->output_section)->this_hdr.sh_type) + { + case
>   >> SHT_PREINIT_ARRAY: need_preinit_array = 1; - if (strcmp
>   >> (bfd_section_name (sub, o), ".init_array") == 0) +
>   >> initfini_array++;
> 
>   Alan> Presumably, initfini_array is trying to cut short the section
>   Alan> search after finding one of each of the section types.  I
>   Alan> can't see anything in the ELF spec that precludes having, say,
>   Alan> three SHT_PREINIT_ARRAY input sections.  Best get rid of
>   Alan> initfini_array entirely.
> 
> The loop really only needs to determine whether any _input_ sections
> contain the preinit/init/fini arrays.  You could use a bitmask and
> stop the search as soon as all three array sections have occurred at
> least once.
> 
> I considered doing that but opted not to do so for clarity and because
> I wasn't sure how often preinit arrays will be used: if it turns out
> that most executables do not use preinit arrays, then the optimization
> won't be very useful.

The problem is you are searching all input files. It doesn't matter
they are used or not.

> 
>   Alan> The other thing is that you'll need to extend your patch a
>   Alan> little to handle these section types in bfd_section_from_shdr.
> 
> Also, note that elfxx-ia64.c already has code to set the section
> types.  It's good if this can be moved to elf.c, but there is no point
> in keeping two copies of this code.
> 
> 	--david


Here is a new patch. I made a few changes. I use

elf_section_data (o)->this_hdr.sh_type 

since 

elf_section_data (o->output_section)

is 0 when it is called. Also, those new sections should be in the
data segment. And I fixed a few typos.

BTW, should we allow both .init/.fini and the array sections. If both
exist, how should ld.so treat them?


H.J.
---
2002-03-02  H.J. Lu <hjl@gnu.org>

	* elf.c (bfd_section_from_shdr): Handle special sections,
	.init_array, .fini_array and .preinit_array.
	(elf_fake_sections): Likewise.

	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check the
	section types instead of names for .init_array, .fini_array and
	.preinit_array.

	* elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
	SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
	(elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
	.preinit_array.

2002-03-02  H.J. Lu <hjl@gnu.org>

	* config/obj-elf.c (special_section): Add .init_array,
	.fini_array and .preinit_array.

	* config/tc-ia64.h (ELF_TC_SPECIAL_SECTIONS): Remove
	.init_array and .fini_array.

2002-03-02  H.J. Lu <hjl@gnu.org>

	* scripttempl/elf.sc: Fix a few typos. Put .preinit_array,
	.init_array and .fini_array in the data segment.

--- binutils/bfd/elf.c.array	Tue Feb 19 15:17:40 2002
+++ binutils/bfd/elf.c	Sat Mar  2 09:55:43 2002
@@ -1564,6 +1564,9 @@ bfd_section_from_shdr (abfd, shindex)
     case SHT_NOBITS:	/* .bss section.  */
     case SHT_HASH:	/* .hash section.  */
     case SHT_NOTE:	/* .note section.  */
+    case SHT_INIT_ARRAY:	/* .init_array section.  */
+    case SHT_FINI_ARRAY:	/* .fini_array section.  */
+    case SHT_PREINIT_ARRAY:	/* .preinit_array section.  */
       return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
 
     case SHT_SYMTAB:		/* A symbol table */
@@ -2178,6 +2181,12 @@ elf_fake_sections (abfd, asect, failedpt
       this_hdr->sh_type = SHT_REL;
       this_hdr->sh_entsize = bed->s->sizeof_rel;
     }
+  else if (strcmp (asect->name, ".init_array") == 0)
+    this_hdr->sh_type = SHT_INIT_ARRAY;
+  else if (strcmp (asect->name, ".fini_array") == 0)
+    this_hdr->sh_type = SHT_FINI_ARRAY;
+  else if (strcmp (asect->name, ".preinit_array") == 0)
+    this_hdr->sh_type = SHT_PREINIT_ARRAY;
   else if (strncmp (asect->name, ".note", 5) == 0)
     this_hdr->sh_type = SHT_NOTE;
   else if (strncmp (asect->name, ".stab", 5) == 0
--- binutils/bfd/elflink.h.array	Fri Mar  1 23:44:22 2002
+++ binutils/bfd/elflink.h	Sat Mar  2 10:48:17 2002
@@ -3199,7 +3199,11 @@ NAME(bfd_elf,size_dynamic_sections) (out
   bfd_size_type soname_indx;
   bfd *dynobj, *sub;
   asection *o;
-  int need_preinit_array = 0, need_init_array = 0, need_fini_array = 0;
+#define PREINIT_ARRAY_MASK	1
+#define INIT_ARRAY_MASK		2
+#define FINI_ARRAY_MASK		4
+#define ALL_ARRAY_MASK		7
+  int dt_array = 0;
   struct elf_backend_data *bed;
   struct elf_assign_sym_version_info asvinfo;
 
@@ -3373,39 +3377,50 @@ NAME(bfd_elf,size_dynamic_sections) (out
       for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
 	for (o = sub->sections; o != NULL; o = o->next)
 	  {
-	    /* yuck, more matching by name... */
+	    int array = 0, arraysz = 0;
 
-	    if (strcmp (bfd_section_name (sub, o), ".preinit_array") == 0)
-	      need_preinit_array = 1;
-	    if (strcmp (bfd_section_name (sub, o), ".init_array") == 0)
-	      need_init_array = 1;
-	    if (strcmp (bfd_section_name (sub, o), ".fini_array") == 0)
-	      need_fini_array = 1;
-	  }
-      if (need_preinit_array)
-	{
-	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAY,
-				      (bfd_vma) 0)
-	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_PREINIT_ARRAYSZ,
-					 (bfd_vma) 0))
-	    return false;
-	}
-      if (need_init_array)
-	{
-	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAY,
-				      (bfd_vma) 0)
-	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_INIT_ARRAYSZ,
-					 (bfd_vma) 0))
-	    return false;
-	}
-      if (need_fini_array)
-	{
-	  if (!elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAY,
-				      (bfd_vma) 0)
-	      || !elf_add_dynamic_entry (info, (bfd_vma) DT_FINI_ARRAYSZ,
-					 (bfd_vma) 0))
-	    return false;
+	    switch (elf_section_data (o)->this_hdr.sh_type)
+	      {
+	      case SHT_PREINIT_ARRAY:
+		if ((dt_array & PREINIT_ARRAY_MASK) == 0)
+		  {
+		    array = DT_PREINIT_ARRAY;
+		    arraysz = DT_PREINIT_ARRAYSZ;
+		    dt_array |= PREINIT_ARRAY_MASK;
+		  }
+		break;
+	      case SHT_INIT_ARRAY:
+		if ((dt_array & INIT_ARRAY_MASK) == 0)
+		  {
+		    array = DT_INIT_ARRAY;
+		    arraysz = DT_INIT_ARRAYSZ;
+		    dt_array |= INIT_ARRAY_MASK;
+		  }
+		break;
+	      case SHT_FINI_ARRAY:
+		if ((dt_array & FINI_ARRAY_MASK) == 0)
+		  {
+		    array = DT_FINI_ARRAY;
+		    arraysz = DT_FINI_ARRAYSZ;
+		    dt_array |= FINI_ARRAY_MASK;
+		  }
+		break;
+	      default:
+	      }
+
+	    if (array)
+	      {
+		if (!elf_add_dynamic_entry (info, (bfd_vma) array,
+					    (bfd_vma) 0)
+		    || !elf_add_dynamic_entry (info, (bfd_vma) arraysz,
+					       (bfd_vma) 0))
+		  return false;
+	      }
+
+	    if ((dt_array & ALL_ARRAY_MASK) == ALL_ARRAY_MASK)
+	      goto array_done;
 	}
+array_done:
 
       dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
       /* If .dynstr is excluded from the link, we don't want any of
--- binutils/bfd/elfxx-ia64.c.array	Tue Feb 19 15:18:24 2002
+++ binutils/bfd/elfxx-ia64.c	Sat Mar  2 10:21:20 2002
@@ -1016,9 +1016,6 @@ elfNN_ia64_section_from_shdr (abfd, hdr,
   switch (hdr->sh_type)
     {
     case SHT_IA_64_UNWIND:
-    case SHT_INIT_ARRAY:
-    case SHT_FINI_ARRAY:
-    case SHT_PREINIT_ARRAY:
     case SHT_IA_64_HP_OPT_ANOT:
       break;
 
@@ -1076,12 +1073,6 @@ elfNN_ia64_fake_sections (abfd, hdr, sec
     }
   else if (strcmp (name, ELF_STRING_ia64_archext) == 0)
     hdr->sh_type = SHT_IA_64_EXT;
-  else if (strcmp (name, ".init_array") == 0)
-    hdr->sh_type = SHT_INIT_ARRAY;
-  else if (strcmp (name, ".fini_array") == 0)
-    hdr->sh_type = SHT_FINI_ARRAY;
-  else if (strcmp (name, ".preinit_array") == 0)
-    hdr->sh_type = SHT_PREINIT_ARRAY;
   else if (strcmp (name, ".HP.opt_annot") == 0)
     hdr->sh_type = SHT_IA_64_HP_OPT_ANOT;
   else if (strcmp (name, ".reloc") == 0)
--- binutils/gas/config/obj-elf.c.array	Fri Mar  1 23:44:32 2002
+++ binutils/gas/config/obj-elf.c	Sat Mar  2 00:10:52 2002
@@ -595,6 +595,9 @@ static struct special_section const spec
   { ".rodata",	SHT_PROGBITS,	SHF_ALLOC			},
   { ".rodata1",	SHT_PROGBITS,	SHF_ALLOC			},
   { ".text",	SHT_PROGBITS,	SHF_ALLOC + SHF_EXECINSTR	},
+  { ".init_array",SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE         }, 
+  { ".fini_array",SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE         },
+  { ".preinit_array",SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE   }, 
 
 #ifdef ELF_TC_SPECIAL_SECTIONS
   ELF_TC_SPECIAL_SECTIONS
--- binutils/gas/config/tc-ia64.h.array	Tue Jan 15 11:30:50 2002
+++ binutils/gas/config/tc-ia64.h	Sat Mar  2 00:10:52 2002
@@ -124,8 +124,6 @@ extern void ia64_after_parse_args PARAMS
 #define WORKING_DOT_WORD	/* don't do broken word processing for now */
 
 #define ELF_TC_SPECIAL_SECTIONS						   \
-{ ".init_array",SHT_INIT_ARRAY,	SHF_ALLOC + SHF_WRITE                   }, \
-{ ".fini_array",SHT_FINI_ARRAY,	SHF_ALLOC + SHF_WRITE                   }, \
 { ".sbss",	SHT_NOBITS,	SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, \
 { ".sdata",	SHT_PROGBITS,	SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
 
--- binutils/ld/scripttempl/elf.sc.array	Fri Mar  1 23:45:33 2002
+++ binutils/ld/scripttempl/elf.sc	Sat Mar  2 10:43:32 2002
@@ -246,23 +246,6 @@ cat <<EOF
     ${RELOCATING+${INIT_END}}
   } =${NOP-0}
 
-  /* Ensure the __preinit_array_start label is properly aligned.  We
-     could instead move the label definition inside the section, but
-     the linker would then create the section even if it turns out to
-     be empty, which isn't pretty.  */
-  ${RELOCATING+. = ALIGN(${ALIGNMENT})}
-  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
-  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
-  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
-
-  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .)}};
-  .init_array   ${RELOCATING-0} : { *(.init_array) }
-  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
-
-  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
-  .fini_array   ${RELOCATING-0} : { *(.fini_array) }
-  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
-
   ${DATA_PLT-${BSS_PLT-${PLT}}}
   .text         ${RELOCATING-0} :
   {
@@ -293,6 +276,23 @@ cat <<EOF
   ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 
+  /* Ensure the __preinit_array_start label is properly aligned.  We
+     could instead move the label definition inside the section, but
+     the linker would then create the section even if it turns out to
+     be empty, which isn't pretty.  */
+  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
+  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
+  .init_array   ${RELOCATING-0} : { *(.init_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
+
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
+  .fini_array   ${RELOCATING-0} : { *(.fini_array) }
+  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
+
   .data         ${RELOCATING-0} :
   {
     ${RELOCATING+${DATA_START_SYMBOLS}}

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-03-02 10:59                       ` H . J . Lu
@ 2002-03-02 11:13                         ` David Mosberger
  2002-03-02 11:27                           ` H . J . Lu
  0 siblings, 1 reply; 18+ messages in thread
From: David Mosberger @ 2002-03-02 11:13 UTC (permalink / raw)
  To: H . J . Lu
  Cc: davidm, Alan Modra, Richard Henderson, Ulrich Drepper,
	GNU libc hacker, binutils

>>>>> On Sat, 2 Mar 2002 10:59:39 -0800, "H . J . Lu" <hjl@lucon.org> said:

  HJ> The problem is you are searching all input files. It doesn't
  HJ> matter they are used or not.

Doesn't your patch do the same?  It's safe to create the entries
needlessly, though it would obviously be better if that didn't happen.
If you know a way to do that, great.

  HJ> Here is a new patch.

Looks to me like this could end up creating the same DT*ARRAY entries
multiple times, no?

  HJ> Also, those new sections should be in the data segment.

Good point.

  HJ> BTW, should we allow both .init/.fini and the array sections.

Yes.

  HJ> If both exist, how should ld.so treat them?

See the Sys V ABI.  IIRC, .init gets executed before .init_array and
.fini_array gets executed before .fini.

	--david

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
  2002-03-02 11:13                         ` David Mosberger
@ 2002-03-02 11:27                           ` H . J . Lu
  0 siblings, 0 replies; 18+ messages in thread
From: H . J . Lu @ 2002-03-02 11:27 UTC (permalink / raw)
  To: davidm
  Cc: Alan Modra, Richard Henderson, Ulrich Drepper, GNU libc hacker, binutils

On Sat, Mar 02, 2002 at 11:13:13AM -0800, David Mosberger wrote:
> >>>>> On Sat, 2 Mar 2002 10:59:39 -0800, "H . J . Lu" <hjl@lucon.org> said:
> 
>   HJ> The problem is you are searching all input files. It doesn't
>   HJ> matter they are used or not.
> 
> Doesn't your patch do the same?  It's safe to create the entries
> needlessly, though it would obviously be better if that didn't happen.
> If you know a way to do that, great.

Mine stops as soon as all 3 sections are found.

> 
>   HJ> Here is a new patch.
> 
> Looks to me like this could end up creating the same DT*ARRAY entries
> multiple times, no?

Mine checks the mask. It sets array/arraysz and the mask if the mask is
0. It only creates the DT entry if array is not 0. If the mask is not
0, array will be 0 and no duplicated DT entry will be added.

> 
>   HJ> Also, those new sections should be in the data segment.
> 
> Good point.
> 
>   HJ> BTW, should we allow both .init/.fini and the array sections.
> 
> Yes.
> 
>   HJ> If both exist, how should ld.so treat them?
> 
> See the Sys V ABI.  IIRC, .init gets executed before .init_array and
> .fini_array gets executed before .fini.
> 

How should we deal with "ld -init SYMBOL -fini SYMBOL"? Right now, ld
will replace .init/.fini sections with those symbols. Should we add
"-init-array SYMBOL"?


H.J.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2002-03-02 19:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-28 14:38 [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections Ulrich Drepper
2002-02-28 16:58 ` H . J . Lu
2002-02-28 17:19   ` David Mosberger
2002-02-28 17:28     ` Ulrich Drepper
2002-02-28 17:33     ` H . J . Lu
2002-02-28 17:43       ` David Mosberger
     [not found]         ` <20020228175426.A30756@redhat.com>
2002-02-28 18:01           ` David Mosberger
2002-02-28 18:11           ` H . J . Lu
2002-02-28 22:42           ` David Mosberger
     [not found]             ` <20020228225757.A30933@redhat.com>
2002-03-01 10:24               ` David Mosberger
     [not found]                 ` <20020301164725.C31581@redhat.com>
2002-03-01 16:56                   ` David Mosberger
     [not found]                     ` <20020301170010.A31610@redhat.com>
2002-03-01 17:20                       ` David Mosberger
     [not found]                         ` <20020301172558.A31648@redhat.com>
2002-03-01 17:36                           ` David Mosberger
2002-03-02  0:36                 ` H . J . Lu
     [not found]                   ` <20020302101931.GM1059@bubble.sa.bigpond.net.au>
2002-03-02  9:24                     ` David Mosberger
2002-03-02 10:59                       ` H . J . Lu
2002-03-02 11:13                         ` David Mosberger
2002-03-02 11:27                           ` H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).