This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ld 'problem'
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: ld 'problem'
- From: Igmar Palsenberg <i dot palsenberg at jdimedia dot nl>
- Date: Mon, 18 Dec 2000 12:07:07 +0100 (CET)
- cc: Igmar Palsenberg <i dot palsenberg at jdimedia dot nl>, <help-gcc at gnu dot org>
Hi,
> > However, this is a no go. Anyone an idea what I'm missing here ??
>
> > I I replace the .a file with the names of all .o files in those archive it
> > starts working... I'm totally lost here.
>
> When you link with a static library, only symbols whose definitions
> are being looked for will be pulled into the resulting executable or
> shared library. If you've got GNU ld, you may enclose the libraries
> you want to link as a whole within -Xlinker -whole-archive and
> -Xlinker -no-whole-archive. A few other linkers offer similar
> features with different command-line options.
I solved it by using the main code as .o file, and the dynamic stuff with
.a
Worked like a charm :)
I indeed used the -whole-archive option, but that left me with an 1 MB
executable. After looking at the internal code, there was no need to link
the additional libs, the pam_init() functions load them.
Is there a way to tell gcc / linker not to export certain symbols ?
That should make things a lot cleaner, and prevents users from calling
internal functions.
Thanx,
Igmar
--
--
Igmar Palsenberg
JDI Media Solutions
Jansplaats 11
6811 GB Arnhem
The Netherlands
mailto: i.palsenberg@jdimedia.nl
PGP/GPG key : http://www.jdimedia.nl/formulier/pgp/igmar