Re: .s files - different ways to compile it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



isn't that because gcc automatically includes crt1.o which would make it's
own entry point (_start) which would call main

Unless I'm mistaking, that might be the reason why it won't compile.
Still, why does as+ld work when you use _main?

- Candy

On Mon, 13 Jan 2003, Eugene Teo wrote:

> I realised that I can compile it, just that when I have a label like
> _main, and when I specify .global _main, it won't compile. Let me read
> more of the docs.
>
> <quote who="Eugene Teo">
> > Hi friends,
> >
> > I wrote 2 assembly files, but I noticed that if I programmed
> > it with sections, I won't be able to use gcc to compile it.
> > I am, however, able to use as, then ld to make it into an
> > executable file though. Any idea why?
> >
> > (sorry if you think this is a wrong forum to post such questions)
> >
> > Eugene
> > --
> > eMail: eugeneteo@eugeneteo.net, eugeneteo@null.cc.uic.edu
> > gpg pub_key: http://null.cc.uic.edu/~eugeneteo/eugeneteo.asc
> > main(i){putchar(182623909>>(i-1)*5&31|!!(i<7)<<6)&&main(++i);}
> >
> > --
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive:       http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
> >
>
> --
> eMail: eugeneteo@eugeneteo.net, eugeneteo@null.cc.uic.edu
> gpg pub_key: http://null.cc.uic.edu/~eugeneteo/eugeneteo.asc
> main(i){putchar(182623909>>(i-1)*5&31|!!(i<7)<<6)&&main(++i);}
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux