From owner-freebsd-hackers Fri Feb 5 17:06:52 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA03905 for freebsd-hackers-outgoing; Fri, 5 Feb 1999 17:06:52 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA03900 for ; Fri, 5 Feb 1999 17:06:50 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id RAA03164; Fri, 5 Feb 1999 17:06:46 -0800 (PST) (envelope-from jdp@polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.9.1/8.9.1) id RAA31729; Fri, 5 Feb 1999 17:06:46 -0800 (PST) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199902060044.RAA20812@usr02.primenet.com> Date: Fri, 05 Feb 1999 17:06:46 -0800 (PST) Organization: Polstra & Co., Inc. From: John Polstra To: Terry Lambert Subject: Re: ldconfig and libraries Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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