🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3622

Re: Force linking of .a?

#3622
From: Casper H.S. Dik - Network Securi...
Date: Tue, 11 May 1999 00:00
38 lines
2197 bytes
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

psmith@baynetworks.com (Paul D. Smith) writes:

>Until now this hasn't been an issue, but now we're trying to introduce
>some dynamic loading using dlopen(), etc.  Yes, we do need to do it this
>way :).

>The problem is that some of the .so's need some particular functions,
>but nothing in the core binary needs those functions.  Since they're in
>archives but nothing references them during the link, they're not pulled
>into the core.  Since they're needed by more than one dynamic object
>(.so), we can't just put them in one.

You need to maek self-contained binaries; this may mean that you need
to make the archive libraries dynamic as well.

>What we'd like to do is find some kind of linker flag (or other method)
>that forces the entire contents of particular .a's to be linked, even if
>nothing appears to reference any of the symbols in some of the .o's in
>the archive.

Newer versions of the Solaris linker support "-z allextract" which
causes complete .a libraries to be loaded.

>I tried the docs for ld(1) but didn't see anything; surely this isn't
>such an unusual requirement?  Anyone have any ideas?

No, hence the new feature.  You may get lucky installing the latest
2.5.1 linker patches.


Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Technical Details
Message-ID: <casper.926418949@nl-usenet.sun.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <p5ogjs8dgz.fsf@baynetworks.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,9f41c0c55a58cbbd
X-Google-Attributes: gid11318c,public
X-Google-Thread: fc89c,9f41c0c55a58cbbd
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 11035d,9f41c0c55a58cbbd
X-Google-Attributes: gid11035d,public
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Force linking of .a?
Date: 1999/05/11
Message-ID: <casper.926418949@nl-usenet.sun.com>
X-Deja-AN: 476535979
References: <p5ogjs8dgz.fsf@baynetworks.com>
Mail-Copies-To: never
Organization: Sun Microsystems, Netherlands
Newsgroups: comp.unix.programmer,comp.unix.solaris,gnu.gcc.help