This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
- From: David Mosberger <davidm at napali dot hpl dot hp dot com>
- To: "H . J . Lu" <hjl at lucon dot org>
- Cc: davidm at hpl dot hp dot com, binutils at sources dot redhat dot com, GNU C Library <libc-alpha at sources dot redhat dot com>, gcc at gcc dot gnu dot org
- Date: Sat, 2 Mar 2002 13:56:56 -0800
- Subject: Re: [David Mosberger <davidm@hpl.hp.com>] problem with unwind info for .init/.fini sections
- References: <20020302101931.GM1059@bubble.sa.bigpond.net.au><15489.2452.737686.119846@napali.hpl.hp.com><20020302105939.A29014@lucon.org><15489.9289.875243.619282@napali.hpl.hp.com><20020302112708.A29383@lucon.org><15489.10696.478128.294511@napali.hpl.hp.com><20020302122820.A30304@lucon.org><15489.14523.106980.19024@napali.hpl.hp.com><20020302125350.A30699@lucon.org><15489.15527.409686.667458@napali.hpl.hp.com><20020302134344.A31230@lucon.org>
- Reply-to: davidm at hpl dot hp dot com
>>>>> On Sat, 2 Mar 2002 13:43:44 -0800, "H . J . Lu" <hjl@lucon.org> said:
HJ> I noticed 2 problems:
HJ> 1. glibc doesn't support .*_array in executales. elf/dl-init.c is not
HJ> used on executables. However, sysdeps/generic/libc-start.c doesn't
HJ> know how to do it. Glibc needs to be modified to call those functions
HJ> with __*_array_start/__*_array_end.
Yes, I noticed that, too. Wouldn't libc-start.c also have to call the
preinit array if the program is statically linked?
HJ> We can use
HJ> + { ".init_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
HJ> + { ".fini_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
HJ> + { ".preinit_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
HJ> in gas and let bfd to set the section type. Or we can teach gcc about
HJ> those special sections.
The latter seems better. On targets where this is supported, we'll
want gcc to use the arrays at any rate (it's certainly true for ia64,
due to the unwind issues that started this discussion).
--david