This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: LMA access segfault on x86 PC


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


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