This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Is '$ORIGIN' supposed to work within DT_NEEDED sections?
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Sasha Unknown <sasha2048 at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 30 Nov 2016 19:16:56 -0800
- Subject: Re: Is '$ORIGIN' supposed to work within DT_NEEDED sections?
- Authentication-results: sourceware.org; auth=none
- References: <23ad2fb0-fb69-aae6-0199-144d59e08d05@gmail.com> <c43852e6-45f1-2965-4238-702f0ce16188@redhat.com> <a2ca5267-927b-f2f8-7049-45b57159a62c@gmail.com>
>> Yes, $ORIGIN is supposed to work
> Please, note, that I'm talking not about putting '$ORIGIN' into 'RPATH'
> field, but about putting it directly into 'NEEDED' field. E.g. not about
> this:
> objdump -p file | egrep RPATH\|NEEDED
> RPATH $ORIGIN/dir1:$ORIGIN/dir2/dir3
> NEEDED lib1.so
> NEEDED lib2.so
> … but about this:
> objdump -p file | egrep RPATH\|NEEDED
> NEEDED $ORIGIN/dir1/lib1.so
> NEEDED $ORIGIN/dir2/dir3/lib2.so
> Did you notice it?
Yes, it's supposed to work. From "Substitution Sequences" in the gABI:
"Within a string provided by dynamic array entries with the DT_NEEDED
or DT_RUNPATH tags and in pathnames passed as parameters to the
dlopen() routine, a dollar sign ($) introduces a substitution
sequence. ..."
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#substitution
-cary