@elfpipe
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
This is the part of linker script (the .xs one) that is used at moment (same for .dtors)
Now the whildcard *should* include also shcrtbegin/end (I suppose even if the comment is vague)
So I don't understand why sections are in the libraries but empty
I've also noticed that .__preinit_array/.init_array/.fini_array and all other modern stuff is already there. So, linker side should be ok to use that sections and you could add them into elf.library.
But i've also seen that our eamigaos.c file is really old compared newer one. Even eelf32ppc.c file is more newer and doesn't has hardcoded stuff.
First of all i'm removing all hardcoded stuff and using amigaos.* scripts that are present in the ldscripts folder.
I'll keep you informed. However there is something wrong in our adtools for sure.