Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 1996 12:51:44 -0700 (PDT)
From:      Jake Hamby <jehamby@lightside.com>
To:        James Drobina <jdrobina@infinet.com>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: Linker from Slackware always produces staticly linked programs
Message-ID:  <Pine.AUX.3.94.960919140302.29880A-100000@covina.lightside.com>
In-Reply-To: <Pine.BSF.3.91.960919094308.580A-100000@drobina.my.domain>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 19 Sep 1996, James Drobina wrote:

> 
> I installed gcc, ld, the libraris, etc from Linux Slackware 96 into 
> /compat/linux.  I built hello world.   When I tried to run it, it core 
> dumped.
> 
> I am running FreeBSD 2.2-CURRENT built Thu Sep 19 07:50:53.
> 
> I've narrowed the problem down to program being statically rather than 
> dynamically linked.  I could not force linker to dynamically link the 
> program.
> 
> The linker distribued with SLackware 96 is
> $ ld -v
> ld version cygnus-2.6 (with BFD 2.6.0.14)
> 
> If I replace the Slackare 96 linker with an older version.  I can link 
> dynamic programs and hello world works.  I backed the linker out and 
> replaced it with
> 
> $ ./ld -v
> ld version cygnus/linux-2.5.2l.17 (with BFD cygnus/linux-2.5.2l.11)
> 
> Has anyone seen this problem? Is it a slackware problem or an emulation
> problem?

It's an ELF problem.  Last time I looked at the code, the ELF loader
figured out whether it was loading a FreeBSD, Linux, or SVR4 ELF binary by
the name of the dynamic loader (ld.so), which is in a different directory
on each of the three. For statically linked programs, there is physically
no way to tell the difference between ELF programs for each OS (!) so it
assumes a native FreeBSD ELF program (yes there is such a beast, there is
an elfkit available for download, I believe on freefall.freebsd.org). 

We're caught between a rock and a hard place here, because on the one
hand, any statically linked ELF binary is most likely to be Linux, simply
because nobody's using FreeBSD ELF yet (because, unlike Linux, our a.out
format doesn't suck :-), but on the other hand, if/when we do decide to
move to ELF, there _will_ be a lot of statically linked _FreeBSD_ ELF
binaries.

I guess the solution is to find or make an a.out (or dynamically linked
ELF) version of the programs in question.

-- Jake






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.AUX.3.94.960919140302.29880A-100000>