This is the mail archive of the 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: sparc elf

On 6/12/06, Paul Brook <> wrote:
On Monday 12 June 2006 17:58, Martin Guy wrote:
> 2006/6/12, Niklaus <>:
> > 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.

Yeah thats a point to be noted. So i build with target sparc-solaris.
Is that correct.
You should generally also use gcc to link not use ld directly because the gcc
driver knows what options to pass to ld.

Few questions 1) I can build binutils for sparc-solaris, it works fine. 2) i can build core-gcc for sparc-solaris 3) How do i build the complete gcc for sparc-solaris. I don't have the headers . I can't use linux headers or glibc as i don't have them on the target machine. 4) Say if i use newlib for target sparc-solaris, then i will have to write linker scripts. 5) Now how do i compile a hello world program executable and run it on my sparc solaris 10 machine.


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