Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Oct 1998 13:15:59 -0700
From:      John Polstra <jdp@polstra.com>
To:        Jin Guojun (FTG staff) <jin@george.lbl.gov>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: ld for loading dynamic library changed in 3.0-RELEASE? 
Message-ID:  <199810232015.NAA29025@austin.polstra.com>
In-Reply-To: Your message of "Fri, 23 Oct 1998 10:11:13 PDT." <199810231711.KAA07769@george.lbl.gov> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



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