Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Feb 1999 17:06:46 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: ldconfig and libraries
Message-ID:  <XFMail.990205170646.jdp@polstra.com>
In-Reply-To: <199902060044.RAA20812@usr02.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Terry Lambert wrote:
>> > Having experienced both sides of this, what I think would be good would
>> > be to be able to edit the RPATH in executables.  That would allow the
>> > sysadmin to override it selectively.  I don't know if that is feasible
>> > or not.
>> 
>> That would be useful, but I'm afraid it may not be feasible for
>> executables.  The RPATH string is in the .dynstr section, which
>> precedes text, data, and bss in the address space.  If you made the
>> string longer, it would change the load addresses of text, data, and
>> bss.  But executables don't contain the relocation information needed
>> for making the necessary adjustments in that case.
> 
> Sounds like it's in the wrong order in the file...

No it's not.  It's a read-only section (section, not segment), so at
load time it needs to end up in a read-only segment (segment, not
section).  On most OSs the only read-only segment is the text segment.
So it has to be in the same segment as text.  Given that, it doesn't
matter whether it comes before or after the actual program code,
because in either case it will precede the data segment.  Therefore,
changing its size will move the data segment.

John
---
  John Polstra                                               jdp@polstra.com
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Nobody ever went broke underestimating the taste of the American public."
                                                            -- H. L. Mencken

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.990205170646.jdp>