Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: linker question



On Thu, 11 Jun 1998, Scott Stone wrote:

> Is it possible to take an existing dynamically linked binary and
> statically link it?

Theoretically.  I managed to do it a couple of years ago with HJ's ELF
libc, I don't think you can do it under glibc.

> It *sounds* possible, but is it?  If so, how?

Hmmm.  IIRC, it was a combination of binutils-2.5.(mumble), gcc-2.6.3, and
feeding -N (1) to the link stage.

I linked with -N by accident.  I didn't have any static libraries on my
system at that time (if memory serves).  The resultant binary ran without
invoking ld-linux.so.1, so I _think_ I achieved what you're looking for.

As I felt that such was undesired behavior, I've never tried to reproduce
it.

--	Chris (wileyc@example.com)

(1) Under a.out, -N would fold the text segment into the code segment ...
resulting in a slightly smaller binary.  Worked well in some situations,
broke daemons.

--------------------------------------------------------------
Next TLUG Meeting: 13 June Sat, Tokyo Station Yaesu gate 12:30
Featuring Stone and Turnbull on .rpm and .deb packages
Next Nomikai: 17 July, 19:30 Tengu TokyoEkiMae 03-3275-3691
After June 13, the next meeting is 8 August at Tokyo Station
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links