This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
is main() provided by a library valid C ?
- From: "Peter S. Mazinger" <ps dot m at gmx dot net>
- To: binutils at sourceware dot org
- Cc: Joakim dot Tjernlund at lumentis dot se
- Date: Fri, 13 May 2005 09:47:01 +0200 (CEST)
- Subject: is main() provided by a library valid C ?
Hello!
Is it valid C to have main() been provided by a library instead of an
object at link time?
2 apps (bind and subversion) fail their tests, because the object
providing main() is packed into an archive or is provided by a shared
library and the library is used at link time instead of the object.
The failure at link time:
ld: protected symbol 'main' isn't defined
ld: final link failed: Nonrepresentable section on output
If I modify the Makefile to use the object instead of the library then
linking succeeds.
The circumstances:
The weak definition of main() is moved from libc.so to crt1.o written in
asm as '.protected main'.
Peter
--
Peter S. Mazinger <ps dot m at gmx dot net> ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2