This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
How to control segments ?
- From: Dong Phuong <dongphuong2410 at yahoo dot com>
- To: binutils at sourceware dot org
- Date: Mon, 1 Dec 2008 17:35:05 -0800 (PST)
- Subject: How to control segments ?
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 ?