Re: ld for loading dynamic library changed in 3.0-RELEASE?

[ Available lists | Index of freebsd-hackers | Month of Oct 1998 | Week of 23 Oct 1998 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
John Polstra <jdp@polstra.com>
Date
23 Oct 1998 13:16:39
Subject
Re: ld for loading dynamic library changed in 3.0-RELEASE?
Message-ID
199810232015.NAA29025@austin.polstra.com

Replies

[ Hide this part ]
> There is no manual page for objformat.

Oooops ... sorry! Wanna write one for us? :-)

> BUt by looking the code, I see objformat just looking for
> environmrent or /etc/objformat to tell what format should be used by
> compiler and linker.

Yes, it can use either the OBJFORMAT environment variable or a
command line argument like "-aout" or "-elf".

> It was confused when you told me to use objformat.

It should complain if it is invoked under the name "objformat" and
given any arguments. It's a bug that it doesn't. So I can see why
you were confused by it. I will fix that bug.

> By looking into /usr/lib, I see the default libraries are in elf
> format. The aout format libraries are in /usr/lib/aout which has
> missing X11/lib.

Yes. Generally, people have either ELF X11 libraries or a.out X11
libraries, but not both.

> Will aout/{cc, ld} system co-exists with elf system in the future
> release?

In general, we are phasing out a.out and moving strictly to ELF.
We don't want to be a "choose your object format" system. We will
continue to provide the a.out tools, but they won't be recommended
for new development. Also, to use them you'll have to take extra
steps, such as specifying OBJFORMAT=aout in the environment or adding
"-aout" to the command line.

Don't rely on using a.out to solve build problems, because a.out is
the past and ELF is the future.

> Will elf/ld be modified to behave like other regular ld (or aout/ld)
> not trying to resolve the unused symbols?

No, because it's a _bug_ that the a.out linker doesn't complain about
those undefined symbols. Shared libraries are fundamentally different
from archive libraries. With an archive library, the linker only
loads those members (.o files) that are actually used. But a shared
library is monolithic. You either load all of it or you load none
of it. That means you aren't allowed to have undefined symbols at
link time, even from portions of the shared library that you're not
actually using. Again, reporting such errors is the norm for linkers
on systems that have shared libraries. Our old a.out linker is simply
buggy. I should add that we've gotten a lot of complaints about that
particular bug. So no, I'm not going to add the same bug to our ELF
linker.

John

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


Elapsed time: 0.135 seconds