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]

Re: is main() provided by a library valid C ?


On Fri, May 20, 2005 at 08:38:47AM +0200, Peter S. Mazinger wrote:
> On Fri, 20 May 2005, Joakim Tjernlund wrote:
> 
> > > 
> > > On Thu, May 19, 2005 at 11:14:25PM +0200, Joakim Tjernlund wrote:
> > > > > 
> > > > > On Thu, May 19, 2005 at 10:40:07PM +0200, Joakim Tjernlund wrote:
> > > > > > If my memory serves me right, to build libc w/ -z defs, main needs to be declared
> > > > > > weak in libc.
> > > > > 
> > > > > Incorrect.  Libc doesn't need to mention main at all.  Please look at
> > > > > glibc's CRT files.
> > > > 
> 
> This is becoming out of topic, my question isn't answered though:
> 
> Is it allowed (as of linking) that the function main() been provided by a 
> shared or static library instead of an object (*.o) ?
> 

Linker doesn't really know/care main. If you find out that you have to
make main protected, please provide a small testcase. I will look into
it.


H.J.


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