This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]