Hi,
I'm writing a library that calls the stat() syscall.
Building the library works fine.
When trying to compile a test program that uses this library I get the
following error during link-edit:
---
/usr/bin/ld: tst_lib_1: hidden symbol `stat' in
/usr/lib/libc_nonshared.a(stat.oS) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make: *** [tst_lib_1] Error 1
---
Does anybody have an idea of what is happening?
Versions:
gcc: gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
ld: GNU ld version 2.15.92.0.2 20040927
Note: I tried to compile a small test program that calls stat() without
any intermediate library, and everything worked fine. So I'm wondering
whether the problem comes from the way I'm building my library. Here's
the line extracted from my Makefile:
$(CC) -o $@ -shared -Wl,--whole-archive -Wl,--soname -Wl,$(VSONAME)
-nostdlib -nostartfiles $(COBJS)
Please Cc me, since I'm not subscribed
Thanks for your help,
Nadia