public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: David Kilroy <David.Kilroy@arm.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>, nd <nd@arm.com>
Subject: RE: [PATCH 1/3] elf: Allow dlopen of filter object to work [BZ #16272]
Date: Tue, 22 Oct 2019 11:24:00 -0000	[thread overview]
Message-ID: <AM0PR08MB406882CC53D34D28F39473E791680@AM0PR08MB4068.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <87sgnlksr3.fsf@oldenburg2.str.redhat.com>


> Florian Weimer
> 
> * David Kilroy:
> 
> >> Florian Weimer
> >> * David Kilroy:
> >>
> >> >> Florian Weimer
> >> >> * David Kilroy:
> >> >>
> >> >> >> The Solaris documentation does not mention symbol filtering
> >> >> (constraining
> >> >> >> the set of exported symbols) at run time.  This kind of
> >> >> >> filtering is
> >> >> achieved at
> >> >> >> run time because the link editor only looks at symbols in the
> >> >> >> filter and
> >> >> does
> >> >> >> not consult the filtee.
> >> >> >
> >> >> > My assumption was that on Solaris only the symbols mentioned in
> >> >> > the
> >> >> filter
> >> >> > actually get bound at runtime. I haven't looked at what would
> >> >> > have to be
> >> >> done
> >> >> > to support that behaviour. I'm sounds non-trivial :)
> >> >>
> >> >> I expected that based on the name of the feature, but the Solaris
> >> >> documentation does not support that.  It's only clear that they
> >> >> filter at link time.
> >> >
> >> > [I just wanted to respond to this part of your email here. I'll
> >> > respond to the rest via Szabolcs email.]
> >> >
> >> > The web page does say "The runtime linker uses the filtee to
> >> > resolve any symbols defined by filter.so.1. If the filtee is not
> >> > found, or a filter symbol is not found in the filtee, the filter
> is
> >> > skipped for this symbol lookup."
> >>
> >> It says “not found in the filtee”.  I think this means that the
> >> filter is never used for symbol lookup (something we do not
> implement
> >> in glibc), not that the symbol set of the filtee is restricted to
> >> that of the filter (not implemented either).  It is possible that
> >> there was a typo here in and the roles of filter and filtee are
> >> swapped in this documentation paragraph, though.
> >
> > It makes sense to me. I agree that the filter is never used for
> symbol lookup.
> >
> > filter.so.1, has symbol a(), b() and has DT_FILTER filtee.so.1
> > filtee.so.1, has symbols a(), c()
> >
> > The first sentence says that the symbols defined in filter.so.1 would
> > be resolved from filtee.so.1. So the runtime linker should look for
> > a() and b() in filtee.so.1.
> >
> > The second sentence deals with b(), which is not in the filtee. To me
> > it says that b() shouldn't resolve to the filters implementation, and
> > therefore b() has to come from later in the search path.
> 
> Ahh, thanks for explaining it to me.  So this is the part that
> specifies that filters do actually filtering.
> 
> As I said, I think glibc does not implement this, and I'm not sure if
> implementing it would break your use case (hence my question about
> interposition and default implementations).

Agreed. Glad I could clear up that point :)

If glibc did implement something closer to the Solaris spec, I would
expect what we're doing to continue working. But the current
implementation is sufficient for our purposes (bar the dlopen behaviour)


Thanks,

Dave.

  reply	other threads:[~2019-10-22 11:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 10:33 [PATCH 0/3] " David Kilroy
2019-10-17 10:33 ` [PATCH 3/3] elf: avoid stack allocation in dl_open_worker David Kilroy
2019-10-17 10:33 ` [PATCH 1/3] elf: Allow dlopen of filter object to work [BZ #16272] David Kilroy
2019-10-18 11:43   ` Florian Weimer
2019-10-18 15:09     ` David Kilroy
2019-10-21 11:27       ` Florian Weimer
2019-10-21 14:12         ` David Kilroy
2019-10-21 14:21           ` Florian Weimer
2019-10-21 16:42             ` Szabolcs Nagy
2019-10-22  9:22               ` David Kilroy
2019-10-22  9:49                 ` Florian Weimer
2019-10-22 11:20                   ` David Kilroy
2019-10-22  9:43               ` Florian Weimer
2019-10-22 11:18                 ` David Kilroy
2019-10-22 11:22                   ` Florian Weimer
2019-10-22 11:27                     ` David Kilroy
2019-10-22 11:31                       ` Florian Weimer
2019-10-22  8:28             ` David Kilroy
2019-10-22  8:36               ` Florian Weimer
2019-10-22  9:39                 ` David Kilroy
2019-10-22  9:57                   ` Florian Weimer
2019-10-22 11:24                     ` David Kilroy [this message]
2019-10-22 14:29     ` David Kilroy
2019-10-17 10:33 ` [PATCH 2/3] elf: avoid redundant sort in dlopen David Kilroy

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=AM0PR08MB406882CC53D34D28F39473E791680@AM0PR08MB4068.eurprd08.prod.outlook.com \
    --to=david.kilroy@arm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).