On Feb 27 10:12:21 CST 2014, Ed Maste <emaste at freebsd.org wrote:

Aha, I think I've finally found a reference that makes sense of
DF_ORIGIN, in this decade-old SCO documentation:
http://www.sco.com/developers/gabi/2003-12-17/ch5.dynamic.html

Based on this I think that FreeBSD's rtld is actually in the wrong
here, and an executable's rpath that contains $ORIGIN should undergo
substitution, regardless of the state of the DF_ORIGIN flag.  If I
understand correctly DF_ORIGIN should be necessary only in the case of
an executable that does not use $ORIGIN in an rpath, but later
dlopen()s a library that does.

That said, it still seems safe to just set the flag always.

Ed is correct. The handling of ${ORIGIN} was introduced the Generic Application Binary Interface by July of 2000.

The DF_ORIGIN is only necessary if the a.out does not use ${ORIGIN} in a DT_NEEDED or DT_RUNPATH tag. and expects or anticipates that a $ORIGIN may be encountered later in the execution such as a dlopen() call. DF_ORIGIN was provided as a means of insuring correct results in these delayed pathname resolutions without requiring every a.out to incur the cost of a realpath() for its true location when started.


_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to