🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: at.fido.linux
Article #27

Re: gcc & sin() math.h

#27
From: Herbert Rosmanith
Date: Wed, 24 Jun 1998 00:00
56 lines
1609 bytes
Richard Kail <Richard.Kail@p2.f25.n310.z2.itc.or.at> wrote:
> So, ihr neunmalkluger Haufen:

:->

> ich habe es ausprobiert. Ergebnis:
> Alles Unsinn. Man kann sehr wohl gestrippte Libaries verwenden. Ich habe
> das ausprobiert und es geht. *Fact*

also ... ich haette hier nichts gepostet, wenn ich es nicht selbst ausprobiert
haette:

die sourcen:

# cat bar.c 
void bar() {
    printf("bar\n");
}
# cat foo.c 
void main() {
  bar();
}

erstellen der lib:

# cc -c bar.c 
# ar rcv libbar.a bar.o
r - bar.o

ungestrippt:
# cc -c foo.c 
# cc -o foo foo.o -L/root/test -lbar
# ./foo 
bar

gestrippt:
# strip libbar.a 
# cc -o foo foo.o -L/root/test -lbar
foo.o: In function `main':
foo.o(.text+0x4): undefined reference to `bar'

und weg isser.

ah, jetzt versteh ich ... das scheint sich auf shared-libaries und nicht
auf archive-libraries zu beziehen:

# cc -shared -Wl,-soname,libbar.so -o libbar.so bar.o 
# cc -o foo foo.o -L/root/test -lbar
# ./foo 
bar
# strip libbar.so
# ./foo 
bar
# nm libbar.so
libbar.so: no symbols
Technical Details
Message-ID: <3590c1e4.0@alijku02.edvz.uni-linz.ac.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6ml839$adm$1@news.tuwien.ac.at> <MSGID_2=3A310=2F25.2=40FidoNet_56e5c4d9@fidonet.org>

Show Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII-7-bit
X-Google-Thread: 109314,7126680b96b9284c
X-Google-Attributes: gid109314,public
From: Herbert Rosmanith <herp@wildsau.idv.uni-linz.ac.at>
Subject: Re: gcc & sin() math.h
Date: 1998/06/24
Message-ID: <3590c1e4.0@alijku02.edvz.uni-linz.ac.at>
X-Deja-AN: 365588530
References: <6ml839$adm$1@news.tuwien.ac.at> <MSGID_2=3A310=2F25.2=40FidoNet_56e5c4d9@fidonet.org>
Organization: private site
User-Agent: tin/pre-1.4-971106 (UNIX) (Linux/2.0.33 (i586))
Newsgroups: at.fido.linux