This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Alternate character for dollar sign in $ORIGIN?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 4 Jun 2019 21:36:36 -0400
- Subject: Re: Alternate character for dollar sign in $ORIGIN?
- References: <CAH8yC8nMzTeAWUVa6c=Y504tXZUbdq0aMJmVXbv29+L9Sh_y=g@mail.gmail.com> <1461b09c-ea04-4b9b-9ca8-6c57446e0ffc@redhat.com>
- Reply-to: noloader at gmail dot com
On Tue, Jun 4, 2019 at 9:20 AM Nick Clifton <nickc@redhat.com> wrote:
>
> > Does GNU allow an alternate character?
>
> No. :-(
>
> The relevant code is in ..._search_needed() in ld/emultempl/elf32.em
> where there is:
>
> while ((var = strchr (filename + offset, '$')) != NULL)
>
> So either you are going to have to get creative about escaping the dollar
> sign, or else generate a patch for the linker...
Here are some datapoints, if interested.
Most of the time I can use $ORIGIN/../lib with the following. It
passes through Autotools/Bash/Makefile chain as expected:
RPATH="'""\$\$ORIGIN/../lib""'"
LDFLAGS="... -Wl,-rpath,$RPATH"
About 1 in 4 fail, however. Those that fail seem to do extra escaping
in the Autotools/Bash/Makefile chain and it results in:
$ objdump -p <some prog>
...
NEEDED RIGIN/../lib
One of the failures is OpenLDAP.
Jeff