🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3501

How to eliminate unnecessary shared libraries from binary?

#3501
From: Dennis
Date: Mon, 31 Jan 2005 04:32
17 lines
1579 bytes
Hello all,

    I have several utilities sharing one makefile with common linking flags. 
For example,

            LFLAGS= -lpthread -lm -ljpeg

           (BINPATH)%: %.c
                           $(CC) $(CFLAGS) $(INCLUDE) -o $@ $< -L$(LIBPATH) 
$(LFLAGS)

    The executable is always linked with the 3 shared libraries even if they 
are not necessary which produces the runtime loading error. Is it possible 
for ld smart enough to check the real dependency and linked with them only?

Dennis
 
Technical Details
Message-ID: <ctkccr$sqg$1@netnews.hinet.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!newsfeed.news.ucla.edu!newsfeed.media.kyoto-u.ac.jp!Spring.edu.tw!news.nctu.edu.tw!feeder.seed.net.tw!netnews!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: fc89c,64066ebea43813ab,start
X-Google-Thread: 11318c,64066ebea43813ab,start
X-Google-Attributes: gidfc89c,gid11318c,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!newsfeed.news.ucla.edu!newsfeed.media.kyoto-u.ac.jp!Spring.edu.tw!news.nctu.edu.tw!feeder.seed.net.tw!netnews!not-for-mail
From: "Dennis" <rwlin@avamax.com>
Newsgroups: comp.unix.programmer,gnu.gcc.help
Subject: How to eliminate unnecessary shared libraries from binary?
Date: Mon, 31 Jan 2005 12:32:25 +0800
Organization: HiNetNews
Lines: 19
Message-ID: <ctkccr$sqg$1@netnews.hinet.net>
NNTP-Posting-Host: ns2.avamax.com
X-Trace: netnews.hinet.net 1107145947 29520 61.220.20.103 (31 Jan 2005 04:32:27 GMT)
X-Complaints-To: usenet@HiNetnews.hinet.net
NNTP-Posting-Date: Mon, 31 Jan 2005 04:32:27 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original