Alternate character for dollar sign in $ORIGIN?
Jeffrey Walton
noloader@gmail.com
Wed Jun 5 01:36:00 GMT 2019
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
More information about the Binutils
mailing list