_sbrk: undefined reference to `end' problem

Jonathan S. Shapiro shap@eros-os.com
Tue Jun 3 08:31:00 GMT 2008


Interesting. We chose to do this with a weak symbol from a
platform-specific runtime library, in order to allow the application to
override the selection. Same idea, and the linker script could probably
export a weak symbol if desired.



On Wed, 2008-05-28 at 09:01 +0100, Nick Clifton wrote:
> Hi Jonathan,
> 
> >> Note: putting the "PROVIDE (end = .);" at the end of your linker script 
> >> is incorrect because presumably you have also provided the location of 
> >> the start of the stack...
> > 
> > It is not clear (to me) why start of stack should be encoded within the
> > ELF file.
> 
> It isn't.  It is encoded within the linker script used to link together 
> the object files that make up the executable.  Since the linker script 
> knows the layout of memory on the target board/simulator, it makes sense 
> that the linker script should be responsible for the placement of the 
> start of the stack.
> 
> Cheers
>    Nick
> 



More information about the Newlib mailing list