Date: Fri, 28 Feb 2003 18:32:46 -0800 (PST) From: John Polstra <jdp@polstra.com> To: ports@freebsd.org Cc: joek@mail.flyingcroc.net Subject: Re: WARNING: portupgrade considered harmful Message-ID: <200303010232.h212WkFj000353@vashon.polstra.com> In-Reply-To: <3E5FEE23.8050403@mail.flyingcroc.net> References: <3E5FB1F8.4050405@mail.flyingcroc.net> <3E5FD22B.3040904@mail.flyingcroc.net> <200302282148.h1SLm8pc031639@vashon.polstra.com> <3E5FEE23.8050403@mail.flyingcroc.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <3E5FEE23.8050403@mail.flyingcroc.net>, Joe Kelsey <joek@mail.flyingcroc.net> wrote: > John Polstra wrote: > > No, your memory is fine. It probably was me that you discussed it > > with. But I dropped maintainership of the dynamic linker quite some > > time ago. What I objected to was your putting words in my mouth. > > I am sorry about that. All is forgiven. I'm sorry I snapped at you about it. > What I objected to before and what I still object to in the shared > library is that it allows loading of *multiple* copies of a single > library as many times as are requested. It's not supposed to do that. Do you have a test case that demonstrates it, or some "ldd" output that shows it happening? The code that loads a shared library checks to see if the library is already loaded, and if it is then it just adds a reference to it instead of loading it again. It checks by pathname and it checks by device + inode number. So the only way you could get two copies of the same library would be if it existed in duplicate form as two separate but identical files. Even if one is a symlink or a hard link to the other, it recognizes that they are the same. > It also allows loading of multiple different versions of the same > library as many times as requested. It's true that it allows multiple versions of the same library to be loaded. But it loads each version only once. > Neither Solaris nor SVR4 support this behavior. I haven't tested Solaris lately, but I think you're wrong about SVR4. The SVR4 dynamic linker didn't know anything about version numbers. The concept wasn't even programmed into the dynamic linker. All it knew about was filenames. For example, it might know from parsing an ELF executable that it needed to load "libc.so.4". But although the user thought of the "4" as a version number, the dynamic linker did not. It simply looked for a file named "libc.so.4". That's how our dynamic linker is, too. > I have no idea why the FreeBSD loader supports it. It is > explicitly supported plainly in the code of the runtime loader. I don't know what you mean by that. The code checks for matching files, nothing more and nothing less. It doesn't know anything about version numbers. Reasonable people can argue about whether that's the ideal behavior or not. But it was the de facto standard behavior for ELF dynamic linkers at the time I wrote it. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303010232.h212WkFj000353>