Constructor order help (related to PR 6482)
Richard Henderson
rth@redhat.com
Fri Apr 11 10:44:00 GMT 2003
On Thu, Apr 10, 2003 at 10:51:33PM -0700, Kean Johnston wrote:
> Point me at stuff.
Ok, the first thing I'd like to do is to split crtstuff.c
into multiple files.
Step one I think should be to leave the logic that decides
which method to use in crtstuff.c, and have that #include
the new .c files. Say, crtbe-sec.c (.init section),
crtbe-switch.c (ld -init switch), crtbe-coff.c (iirc there's
something special for that in here), crtbe-macho.c, and
whatever else I've forgotten.
Step two I'm less certain about, but at present I'm thinking
that it might be cleaner to move the choice of which crtbe-*.c
file to use from the ifdef madness that will remain in
crtstuff.c into explicit assignments in config.gcc.
Step three would be to add a new crtbe-array.c that handles
the DT_INIT_ARRAY option.
> *LONG* gone :) I will drag openserver kicking and screaming
> into the early 90's if it kills me :)
I'll look forward to seeing those patches.
> Oh and by the way, I discovered something about our implementation
> of DT_INIT_ARRAY. It is, IMHO, broken. As things currently stand
> this only works for shared libraries. Surprisingly enough, the
> same goes for the .init section. Colour me dumbfounded.
Eww.
> However GAS kinda does the right thing but there's an interesting
> bit of chicanery in gas/config/obj-elf.c relating to this. They
> were working around an old GCC bug and I think we may want to
> persuade the binutils folks to reverse the #if 0 comment in that file.
I suspect that gcc bug is still there. We should fix it somehow.
r~
More information about the Gcc
mailing list