Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #670
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!nerds-end |
|---|---|
| From | Jianfei Hu <hujianfei258@gmail.com> |
| Newsgroups | comp.compilers |
| Subject | Some problem about the elf file while generating the code for compiler |
| Date | Thu, 7 Jun 2012 01:49:57 +0800 |
| Organization | Compilers Central |
| Lines | 20 |
| Sender | news@iecc.com |
| Approved | comp.compilers@iecc.com |
| Message-ID | <12-06-009@comp.compilers> (permalink) |
| NNTP-Posting-Host | news.iecc.com |
| X-Trace | leila.iecc.com 1339018400 3805 64.57.183.58 (6 Jun 2012 21:33:20 GMT) |
| X-Complaints-To | abuse@iecc.com |
| NNTP-Posting-Date | Wed, 6 Jun 2012 21:33:20 +0000 (UTC) |
| Keywords | linker, question, comment |
| Posted-Date | 06 Jun 2012 17:33:20 EDT |
| X-submission-address | compilers@iecc.com |
| X-moderator-address | compilers-request@iecc.com |
| X-FAQ-and-archives | http://compilers.iecc.com |
| Xref | csiph.com comp.compilers:670 |
Show key headers only | 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 | Next — Next in thread | Find similar
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