This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][v2] Add dynamic linker support for $EXEC_ORIGIN.
- From: Brooks Moses <bmoses at google dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, "Carlos O'Donnell" <carlos at redhat dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>
- Date: Fri, 20 Dec 2013 12:24:25 -0800
- Subject: Re: [PATCH][v2] Add dynamic linker support for $EXEC_ORIGIN.
- Authentication-results: sourceware.org; auth=none
- References: <1386634331-21691-1-git-send-email-bmoses at google dot com> <1386886419-18491-1-git-send-email-bmoses at google dot com> <201312201445 dot 52106 dot vapier at gentoo dot org>
On Fri, Dec 20, 2013 at 11:45 AM, Mike Frysinger <firstname.lastname@example.org> wrote:
> this probably should be documented somewhere in glibc (beyond just the code
> itself). a quick scan of the manual though doesn't seem to turn up any
> discussion of topics like rpath or $ORIGIN, so i guess the assumption is that
> we follow the standard ELF conventions. which leads into the next point ...
> shouldn't it also be coordinated (at least loosely) with the linker and ELF
> ABI peeps ? they already fully document (and in some cases implement) the
> semantics of DT_RPATH/DT_RUNPATH, so having glibc add its own (undocumented)
> extensions doesn't seem like a good idea.
Agreed that this needs to be documented, and I was surprised
substitution patterns are not mentioned in the glibc documentation.
However, the $ORIGIN and other similar substituation patterns are
documented in the ld.so manpage that's part of the Linux man-pages
project, and I am planning to submit a patch there once this is
accepted. (See, e.g.,
http://manpages.ubuntu.com/manpages/lucid/man8/ld.so.8.html for a
IIUC, the latest version of the ELF ABI specification is
http://www.sco.com/developers/gabi/latest/contents.html. (That's a
draft from 10 June 2013.) That mentions $ORIGIN, but states that the
behavior for other substitution patterns starting with $ is
"unspecified". We already have a couple of additional extensions in
glibc that are not in the ABI specification: $LIB and $PLATFORM.
Adding another seems not unreasonable.
I'm also not seeing any documentation of these patterns in the GNU
linker manual (https://sourceware.org/binutils/docs-2.24/ld/index.html);
in particular, the -rpath option documentation doesn't mention it. Am
I missing something there? I'd be happy to coordinate if there's
coordination that needs to be done.