mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 3/4] ldso: move (un)map_library functions to separate file
Date: Sat, 28 Mar 2020 23:07:57 -0400	[thread overview]
Message-ID: <20200329030757.GT11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <1585441168-23444-3-git-send-email-rcombs@rcombs.me>

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

  reply	other threads:[~2020-03-29  3:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29  0:19 [musl] [PATCH 1/4] ldso: add option to rewrite the argv block rcombs
2020-03-29  0:19 ` [musl] [PATCH 2/4] ldso: when run via CLI, set auxv as if the app was loaded by the kernel rcombs
2020-03-29  0:19 ` [musl] [PATCH 3/4] ldso: move (un)map_library functions to separate file rcombs
2020-03-29  3:07   ` Rich Felker [this message]
2020-03-29  0:19 ` [musl] [PATCH 4/4] crt: add dcrt1, with support for locating the dynamic loader at runtime rcombs
2020-03-29  2:54 ` [musl] [PATCH 1/4] ldso: add option to rewrite the argv block Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200329030757.GT11469@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).