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

Re: [MiNT] '-e' parameter in gcc



Hi,

On tiistai 25 tammikuu 2011, Andreas Schwab wrote:
> Eero Tamminen <oak@helsinkinet.fi> writes:
> >> /home/mikro/gnu-tools/lib/gcc/m68k-atari-mint/4.5.1/../../../../m68k-
> > 
> > atari-mint/bin/ld: warning: cannot find entry symbol main; defaulting
> > to
> > 
> >> 000000e4
> >> 
> >> /tmp/cc4HfuQ9.o:/tmp/cc4HfuQ9.o:(.text+0x6): undefined reference to
> >> `___main'
> >> collect2: ld returned 1 exit status
> > 
> > Sp... neither of these warnings should be generarated for the program;
> > main() is there so it should be found and because -nostdlib was used,
> > no references to __main should be required?
> 
> A C file that defines the main function will be compiled into an object
> file defining the symbol _main and referencing the symbol __main.

Miro, does the first linker warning go away if you use "-e _main"?

And if you compile a source code without main() and give the name of
the included function name with "-e", does the second error go away?


> > I guess Atari gcc and linker seem to have different interpretation on
> > symbol naming, at least in the case of "-e" option...?
> 
> The compiler driver does not interpret the -e option in any way.  It is
> passed to the linker unchanged.

It should prefix the symbol given with "-e" similarly as symbols compiled
from the C source are[1], shouldn't it?

[1] AFAIK GCC prefixes all symbols with "_" (not just main) as does
SozobonX and AHCC & PureC add this prefix only when "-x" option is used.


	- Eero