How to control segments ?

Dong Phuong dongphuong2410@yahoo.com
Tue Dec 2 01:35:00 GMT 2008


I'm porting for a microcontroler which has segmented
 memory.
 
THe memory is devided into many pages, each page is
 16K. And I'm going to use 256 pages for code. But
 these 256 pages are not continuous in physical
memory,
 so when I want to jump to a function, I have to know
 what is the segment address of this function, and
then
 set the CSP with this value, and jump to it.
 
 So what I want to know is if I'm in a function, is
 there any way for me to know what code segments I'm
 locating in ? If I know this,  when I have to jump to
 another function, I can decide wheather this function
 is in the same segment with the function that I'm
 locating in, and then can decide if I have to change
 the CSP.

I've asked this question on the gcc-mailing list, and
one adviced me to use "linker relaxation". But I don't
know how to implement linker relaxation in Binutils. 

Could you give me some hints for this ? 


      



More information about the Binutils mailing list