_sbrk problems when linking newlib (for h8300s)

Likely, Grant Grant.Likely@gdcanada.com
Mon Mar 31 16:43:00 GMT 2003

'end' is an external reference to the end of allocated RAM.  If you look in
sbrk you will see the line: 'extern char end;' which is an external instead
of stack reference.

You need to define the symbol 'end' in your linker script.  For example,
here is the .bss section of one of my linker scripts for coldfire:

	. = ALIGN(0x4);
	__bss_start = .;
	_end = ALIGN(0x8)
	__end = _end;
	end = _end;
} > ram

-----Original Message-----
From: Michael M Delaney [mailto:mmdst23+@pitt.edu]
Sent: Sunday, March 30, 2003 5:35 PM
To: newlib@sources.redhat.com
Subject: _sbrk problems when linking newlib (for h8300s)

I'm trying to link newlib, and if I use a function from newlib I get the
following error:

/usr/local/h8newlib/h8300-linux-hms/lib/h8300s/int32/libc.a(sbrk.o): In
function `_sbrk':
sbrk.c:17: undefined reference to `end'
make: *** [test] Error 1

I don't understand whats going on here, since I could not find any
refrences to 'end' in the file, just a few #endif's.  I'm using the latest
CVS, I had a problem with the newest release (I forgot exactly what it
was, but it may have been the same thing.)  Does anyone have any
suggestions for how I can fix this?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bric-ram.ld
Type: application/octet-stream
Size: 3113 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20030331/ba96daa0/attachment.obj>

More information about the Newlib mailing list