is main() provided by a library valid C ?
Peter S. Mazinger
ps.m@gmx.net
Fri May 13 11:34:00 GMT 2005
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
More information about the Binutils
mailing list