This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

RE: And now what???


	Hi Brendan,
> There should be answers in the mail archives.  I've posted similar answers
> before.
> Search for "-mads" which is a board supported by the powerpc targeted
> compiler.
	[Stephane Dalton]  You're right, I've found some clues there but
after a bit of reading in the ld manual I came to the conclusion that the -m
option if for specifiying some emulation stuff... not exactly what I need.

	But after a bit of RTFM and a little investigation in the
/usr/local/m68k-psos-elf/lib I've found a linker script which is a good
start point for our application. After using it and fixing the open, close
... functions (they we're not defined but this issue was addressed in the
CrossGcc FAQ) I'm able to do:

	bash-2.02$ m68k-psos-elf-ld -T mvme135.ld testm68k.o -lc
	testm68k.o: In function `main':
	testm68k.o(.text+0xbc): undefined reference to `__main'

	Ok... what's next, I guess I'm not too far from a complete
solution... 

	Any clues...???

	Here's the code if it helps you:

	#include <stdlib.h>
	#include <string.h>
	#include <stdio.h>
	#include <errno.h>
	#include <sys/types.h>
	#include <sys/stat.h>


	off_t   lseek(int fildes, off_t offset,int whence) {errno=ENOSYS;
return -1;}
	int     read (int fildes, void *buf, size_t nbyte) {errno=ENOSYS;
return -1;}
	int     close(int fildes ) {errno=ENOSYS; return -1;}
	int     write(int fildes, const void *buf, size_t nbyte )
{errno=ENOSYS; return -1;}
	int     open (char *f, int flags,...)              {errno=ENOSYS;
return -1;}
	int     fstat(int fd, struct stat *sbuf){errno=ENOSYS; return -1;}
	int     isatty(int fd) {errno=ENOSYS; return -1;}

	int main(void)
	{
	   int i;
	   char buffer[10];

	   for(i=0; i<10;i++)
	   {
	      sprintf(buffer, "%d", i);
	   }

	   return(strlen(buffer));
	}

	And again thanks for your help!




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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