From: Farid Zakaria <fmzakari@ucsc.edu>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] dynlink.c tests
Date: Mon, 23 Oct 2023 11:08:31 -0700 [thread overview]
Message-ID: <CAH4OOv65h74u84fwJJkU0NTjgWcJcUcZxuWbLDiV6YETjGNvEA@mail.gmail.com> (raw)
In-Reply-To: <20231023175730.GB22081@brightrain.aerifal.cx>
Just to be pedantic, few ideas come to mind:
- One could change the symbol count method to only use DT_HASH and it
would succeed until GCC removed it ;)
- The order of resolution for dependencies
- $ORIGIN replacement
I am very appreciative of the codebase.
I'm going through it at the moment "stripping it down" a bit to be for
x86-64 and adding some comments to help me better understand the
process.
I was going to look at whether I can take on a C++ standard as a
dependency as well.
If you are interested in my fork + what I'm hoping to accomplish,
please reach out.
Thank you Rich.
On Mon, Oct 23, 2023 at 10:57 AM Rich Felker <dalias@libc.org> wrote:
>
> On Mon, Oct 23, 2023 at 10:08:41AM -0700, Farid Zakaria wrote:
> > Sorry for the late reply Rich.
> >
> > That's what my current plan of attack is but I was wondering if the
> > musl codebase itself has such a test suite already
> > (something similar to the libc test suite)
> >
> > How do dynlink authors validate they haven't broken any edge cases in
> > program loading?
> > (i.e. such as DT_GNU_HASH etc..)
>
> Generally this code has almost zero churn, and is expected to be that
> way. Your example of gnu hash for example is a pure mathematical
> function that never has any reason to be changed.
>
> On top of that, none of this is code that dynamically succeeds or
> fails based on any complex runtime condition. For the most part,
> either it does the right thing or it doesn't, and if it doesn't,
> nothing would load.
>
> This doesn't mean testability is unwanted, just that this code is
> rather low priority for testing compared to things with a lot more
> dynamic corner cases.
>
> Rich
>
>
> > On Fri, Oct 20, 2023 at 5:00 PM Rich Felker <dalias@libc.org> wrote:
> > >
> > > On Fri, Oct 20, 2023 at 11:18:44AM -0700, Farid Zakaria wrote:
> > > > What's the best way to test dynlink.c ?
> > > > I'm making some small changes (actually just simplifying it by
> > > > removing some code for unneeded arch like DL_FDPIC) but would like to
> > > > make sure I didn't bork anything.
> > > >
> > > > I found https://wiki.musl-libc.org/writing-tests but that seems
> > > > focused strictly on the libc itself.
> > > > Is there a dynamic-loader test suite anyone is familiar with ?
> > >
> > > The general strategy I would use would be to setup recipes to build
> > > binaries/shared libraries that make use of particular dynamic linking
> > > features, then load/execute them in ways that assert that the relevant
> > > feature operated as expected.
> > >
> > > Rich
next prev parent reply other threads:[~2023-10-23 18:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 18:18 Farid Zakaria
2023-10-21 0:00 ` Rich Felker
2023-10-23 17:08 ` Farid Zakaria
2023-10-23 17:57 ` Rich Felker
2023-10-23 18:08 ` Farid Zakaria [this message]
2023-10-24 0:03 ` Rich Felker
2023-10-24 1:23 ` Farid Zakaria
2023-11-05 17:01 ` Fangrui Song
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=CAH4OOv65h74u84fwJJkU0NTjgWcJcUcZxuWbLDiV6YETjGNvEA@mail.gmail.com \
--to=fmzakari@ucsc.edu \
--cc=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).