Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #670

Some problem about the elf file while generating the code for compiler

From Jianfei Hu <hujianfei258@gmail.com>
Newsgroups comp.compilers
Subject Some problem about the elf file while generating the code for compiler
Date 2012-06-07 01:49 +0800
Organization Compilers Central
Message-ID <12-06-009@comp.compilers> (permalink)

Show all headers | View raw


Recently I plan to build a simple compiler by myself. When it comes to
elf file generation, I got a problem.  As the elf file specification
says, the segment's virtual addr should be congruent with the offset
in the file modulo page size. Because this would be good for mmap the
elf file into memory efficiently.

But How, why with the same remainder could enhance the efficiency of
mmap file into memory?  As I think, the process would map the segment
into memory twice. In the first time , the segment content would be
put right next to last segment, and then right at the tail of the
first segment content, the second content would be put once more, but
starting at another page. Draw the picture and this is matching the
requirement. Am I right?

And I feel that to implement the simple compiler, I still need some
low level knowledge.  Could someone give me some suggestion or
recommend good resources?
[Yes, an ELF file can map a page twice if it's in two segments.
You might take a look at my Linkers and Loaders book, and at the old
AT&T System V references for details on using ELF. -John]

Back to comp.compilers | Previous | NextNext in thread | Find similar


Thread

Some problem about the elf file while generating the code for compiler Jianfei Hu <hujianfei258@gmail.com> - 2012-06-07 01:49 +0800
  Re: Some problem about the elf file while generating the code for compiler Robert A Duff <bobduff@shell01.TheWorld.com> - 2012-06-07 15:55 -0400
    Re: Some problem about the elf file while generating the code for compiler BGB <cr88192@hotmail.com> - 2012-06-09 10:26 -0500

csiph-web