OS section organization

Brett Swimley brett.swimley at aedinc.net
Thu May 8 17:25:28 UTC 2003


Thanks Greg, 

This is exactly what I want to do, but I'm not sure about how to identify the
desired code within my linker script.

For example, I'd like to pull the entire /cpukit/score/cpu/m68k/cpu_asm.S file
into this section, but currently it's defined within the .text section (entirely
reasonable).  I tried to mod my linker script to just pull this file into a
section, but was running into a problem (perhaps I needed the entire path?)

Is it preferable to try to identify the desired object files in the linker
script and pull them in rather than modifying the source code to create a
special section that my linker script can use?

Any examples would be appreciated.

Brett

Quoting gregory.menke at gsfc.nasa.gov:

> Its an entirely reasonable approach, provided there are no code
> generation implications for using it (page select bits or different
> instructions, etc...).
> 
> Generally, the approach is to cook up your own link script, then tell
> your linker to use instead of the default bsp script.
> 
> That said, you may have to be clever with your bootstrap to arrange
> your image at runtime.  If you have a romm'ed/flashed/whatevered image
> that copies itself to RAM to run, then you'll need to be a bit smarter
> about location the sections.  What you'll end up doing is creating
> symbols in the linker script to mark where sections are located, then
> referencing those symbols in your relocation code.  We do a lot of
> this kind of thing, so I'd be glad to offer suggestions & examples.
> 
> Gregm
> 


-- 
Brett Swimley
Advanced Electronic Designs
406-585-8892 / 406-585-8893 (fax)
brett.swimley at aedinc.net



More information about the users mailing list