sparc elf

Paul Brook paul@codesourcery.com
Mon Jun 12 17:13:00 GMT 2006


On Monday 12 June 2006 17:58, Martin Guy wrote:
> 2006/6/12, Niklaus <niklaus@gmail.com>:
> > int main()
> > {
> > return 3;
> > }
> >
> > i compiled it using sparc-elf-gcc -c test.c.
> > ./sparc-elf-ld --entry=main test.o -o a.out
> > when i executed a.out on sparc machine it segfaulted and dumped core.
>
> I guess 'cos you set entrypoint=main instead of __start or whatever it
> is called.

More likely you should use the appropriate configuration for your target (eg. 
sparc-linux or sparc-solaris) rather than the generic elf config.

You should generally also use gcc to link not use ld directly because the gcc 
driver knows what options to pass to ld.

Paul

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list