Date: Sat, 6 Feb 1999 02:17:43 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: jdp@polstra.com (John Polstra) Cc: tlambert@primenet.com, hackers@FreeBSD.ORG Subject: Re: ldconfig and libraries Message-ID: <199902060217.TAA26924@usr02.primenet.com> In-Reply-To: <XFMail.990205170646.jdp@polstra.com> from "John Polstra" at Feb 5, 99 05:06:46 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> >> 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. I think we are talking at cross purposes here. You are saying that the section is read-only to the program. I am saying that it shouldn't be read-only to a tool to manipulate the section contents. In that regard, the location of the section should be after the executable code. In reality, the problem is that the executable portion of the code needs to map in at a relative page address. In theory, you should be able to locate the executable code anywhere in the file, as long as you didn't change its relative page alignment, since the virtual and real offsets only need to match up on page boundaries. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. 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?199902060217.TAA26924>