LMA access segfault on x86 PC

Daniel Jacobowitz drow@false.org
Wed Apr 30 16:51:00 GMT 2008


On Wed, Apr 30, 2008 at 06:30:07PM +0500, kishore_2005@dataone.in wrote:
> I am running a sample C program to test memory overlay on Redhat GNU/Linux.
> I want to overlay 2 sections at the same Virtual address.
> They will have different load address. So I need to copy the section data 
> from Load address to Virtual address at runtime.
> Here if I try to access the Virtual address I get Segmentation fault.

You can't do this in an environment with an MMU unless you manage the
page mappings and protections yourself.  You will have to read up on
mmap (MMAP_FIXED) to simulate it.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list