From emaste@FreeBSD.org  Thu Feb 27 16:21:58 2014
Return-Path: <emaste@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 7C6D551E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Feb 2014 16:21:58 +0000 (UTC)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 683D8179F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Feb 2014 16:21:58 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1RGLwPh018776
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Feb 2014 16:21:58 GMT
	(envelope-from emaste@freefall.freebsd.org)
Received: (from emaste@localhost)
	by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1RGLwIG018775;
	Thu, 27 Feb 2014 16:21:58 GMT
	(envelope-from emaste)
Message-Id: <201402271621.s1RGLwIG018775@freefall.freebsd.org>
Date: Thu, 27 Feb 2014 16:21:58 GMT
From: Ed Maste <emaste@freebsd.org>
Reply-To: Ed Maste <emaste@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: rtld does not expand $ORIGIN unless DF_ORIGIN flag is set
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         187114
>Category:       bin
>Synopsis:       rtld(1) does not expand $ORIGIN unless DF_ORIGIN flag is set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 27 16:30:01 UTC 2014
>Closed-Date:    
>Last-Modified:  Wed Apr 16 01:41:59 UTC 2014
>Originator:     Ed Maste
>Release:        FreeBSD 11.0-CURRENT amd64
>Organization:
FreeBSD
>Environment:
System: FreeBSD freefall.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r259961: Fri Dec 27 21:56:39 UTC 2013 peter@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL amd64


>Description:
rtld-elf requires the DF_ORIGIN flag to be set, in order to substitute
$ORIGIN in rpath.  This is not required by Linux's runtime linker, and
apparently not by any other system.

Based on old SCO documentation of the DF_ORIGIN flag it appears the
purpose of the flag is to force early resolution of $ORIGIN for the case
of an executable that does not use $ORIGIN in rpath, but later expects to
dlopen() a library that does.

http://www.sco.com/developers/gabi/2003-12-17/ch5.dynamic.html

The GNU ld documentation describes "-z origin" as "Marks the object may
contain $ORIGIN," which is not particularly helpful.  The GNU gold
linker though hints at the interpretation above: "Mark DSO to indicate
that needs immediate $ORIGIN processing at runtime."

>How-To-Repeat:

>Fix:



>Release-Note:
>Audit-Trail:
>Unformatted:
