From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RDNS_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 8182 invoked from network); 29 Mar 2020 03:08:12 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from unknown (HELO mother.openwall.net) (195.42.179.200) by inbox.vuxu.org with ESMTP; 29 Mar 2020 03:08:12 -0000 Received: (qmail 16107 invoked by uid 550); 29 Mar 2020 03:08:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 16089 invoked from network); 29 Mar 2020 03:08:09 -0000 Date: Sat, 28 Mar 2020 23:07:57 -0400 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20200329030757.GT11469@brightrain.aerifal.cx> References: <1585441168-23444-1-git-send-email-rcombs@rcombs.me> <1585441168-23444-3-git-send-email-rcombs@rcombs.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585441168-23444-3-git-send-email-rcombs@rcombs.me> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH 3/4] ldso: move (un)map_library functions to separate file On Sat, Mar 28, 2020 at 07:19:27PM -0500, rcombs wrote: > --- > ldso/dynlink.c | 270 +-------------------------------------------------- > ldso/map_library.h | 276 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 278 insertions(+), 268 deletions(-) > create mode 100644 ldso/map_library.h > > diff --git a/ldso/dynlink.c b/ldso/dynlink.c > index 5f637fd..0e557b1 100644 > --- a/ldso/dynlink.c > +++ b/ldso/dynlink.c > @@ -154,6 +154,8 @@ extern hidden void (*const __init_array_end)(void), (*const __fini_array_end)(vo > weak_alias(__init_array_start, __init_array_end); > weak_alias(__fini_array_start, __fini_array_end); > > +#include "map_library.h" > + As discussed before, I'd rather just duplicate the relevant part of map_library for dcrt1 than refactor dynlink.c like this. There's a lot of nommu logic that you don't have ready to work for dcrt1, and the presence of that code is obscuring the fact that the operation dcrt1 needs is extremely simple. Also, there are a lot of shims (in patch 4) to fake dynamic linker interfaces and libc functions for the shared map_library.h code to use, which make the reuse clunky. I think at some point it might be possible to factor things sufficiently so that map_library is completely decoupled from dynamic linker interfaces and able to be shared between these two components, but your dcrt1 work has already been held up for around a year and I'd like it to be able to move forward without depending on any refactoring. Would you like me to propose a stripped-down/decoupled version of the function that dcrt1 could use? Rich