* Rich Felker [2015-11-29 18:43:09 -0500]: > On Sun, Nov 29, 2015 at 05:59:25PM +0100, Szabolcs Nagy wrote: > > * Szabolcs Nagy [2015-11-29 16:33:22 +0100]: > > handle DT_PREINIT_ARRAY{SZ} in case of dynamic linking and > > __preinit_array_{start,end} in case of static linking. > > Omission of preinit array support was intentional since it's reserved > for use by the [library] implementation and musl does not use it, and > I've tried to keep mandatory-linked startup code as small as possible > to keep the small-static-binaries people happy. > > However on IRC we discussed that ASan and VTV and perhaps other > similar tools might use it, and such use makes sense, so we may need > to add it. I just don't want to get in a habit of adding whatever > random junk is in the ELF spec when there's no reasonable, > well-defined way for application code to use or depend on it. > > > redefined DYN_CNT because 32 is not enough for DT_PREINIT_ARRAY. > > This should be reviewed for possible problems; IIRC I reduced it to 32 > to avoid having to worry about undefined bitshifts in some code that > can't do 64-bit shifts (because libgcc functions might not yet be > callable) but that code should really hard-code 32 rather than using > DYN_CNT if it's still a problem. > attached another variant in case we will need it (handles DT_PREINIT* separately). i didn't handle the issue described in http://git.musl-libc.org/cgit/musl/commit/?id=19caa25d0a8e587bb89b79c3f629085548709dd4 i don't know if that may apply to the preinit* symbols too.