Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 17 May 2016 23:52:24 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 2/2] add preinit_array support

* Rich Felker <dalias@...c.org> [2015-11-29 18:43:09 -0500]:
> On Sun, Nov 29, 2015 at 05:59:25PM +0100, Szabolcs Nagy wrote:
> > * Szabolcs Nagy <nsz@...t70.net> [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.

View attachment "0001-add-preinit_array-support.patch" of type "text/x-diff" (1977 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.