This is the mail archive of the binutils@sources.redhat.com 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]

Re: linker script question


Thanks!

I have another question I don't know if you could answer.

I would like to initialize my SP and INIT PC when loading memory on my
target.  I want to assign locations 0x0 and 0x4 with these
value.  To do this I wrote a bit of assembly in ramvec.S:

.global _ramvec, _main, _end
_ramvec:
    .word 0x1600000 /* SP */	
    .word _main     /* IPC */

Now I want to load this at location 0x0 using my linker script:

MEMORY
{
	ramvec : ORIGIN = 0x000000, LENGTH = 0x3FC
        ram    : ORIGIN = 0x0003FC, LENGTH = 0x160000 - 0x3FC
}

SECTIONS
{ 
	.ramvec :
	{	
		_ramvec = . ;
		*(.ramvec)
	} > ramvec

        .text : 
	{	
		_start = . ;
		_stext = . ;
		*(.text) 
		_etext = . ;
		_ramstart = . ;
	} > ram
...



Should this work.  Apparently it doesn't and loads everything at 
the start of the text section, 0x3fc.

Am I doing something wrong.  Thanks for your help.

BTW: This is for a 68331 port of ucLinux.

- Nick

DJ Delorie <dj@delorie.com> writes:

> > Yes, but .stab sections are normally neither loaded nor allocated, thus
> > they aren't part of your program's memory image.
> 
> Even if they were loaded, you could probably get away with ignoring
> them anyway.
> 

-- 
- Nick


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