another .fini vs. .fini_array problem
David Mosberger
davidm@napali.hpl.hp.com
Mon Nov 24 17:45:00 GMT 2003
OK, so I found yet another place where things were being put in the
.fini section (which causes unwind problems). The patch below
fixes soinit.c so it puts _fini() in the .fini_array section if
it's available. If it looks fine, please apply.
Thanks,
--david
ChangeLog
2003-11-21 David Mosberger <davidm@hpl.hp.com>
* elf/soinit.c (_fini): Put _fini() in .init_array section if
HAVE_INITFINI_ARRAY is defined.
Index: elf/soinit.c
===================================================================
RCS file: /cvs/glibc/libc/elf/soinit.c,v
retrieving revision 1.10
diff -u -r1.10 soinit.c
--- elf/soinit.c 16 Nov 2001 01:05:54 -0000 1.10
+++ elf/soinit.c 22 Nov 2003 02:57:12 -0000
@@ -78,7 +78,9 @@
/* This function becomes the DT_FINI termination function
for the C library. */
+#ifndef HAVE_INITFINI_ARRAY
void _fini (void) __attribute__ ((section (".fini"))); /* Just for kicks. */
+#endif
void
_fini (void)
{
@@ -96,3 +98,6 @@
# endif
#endif
}
+#ifdef HAVE_INITFINI_ARRAY
+void (*_fini_ptr) (void) __attribute__ ((section (".fini_array"))) = &_fini;
+#endif
More information about the Libc-hacker
mailing list