compiler construction - Where is the "Section to segment mapping" stored in ELF files? -


as part of trying write compiler scratch, i'm working on part handles elf files.

after skimming through several articles , specifications them, still don't quite understand section segment mappings stored. when observing small executables generated nasm+ld, can see .text section somehow mapped onto load-type program header, how?

a small piece of readelf's output when given small (working) executable input:

program headers:   type           offset             virtaddr           physaddr                  filesiz            memsiz              flags  align   load           0x0000000000000000 0x0000000000400000 0x0000000000400000                  0x0000000000000084 0x0000000000000084  r e    200000   section segment mapping:   segment sections...    00     .text  

is mapping required have working executable? or can omitted , still have valid executable?

i still don't quite understand section segment mappings stored.

they not stored anywhere.

rather, readelf computes mapping looking @ file offset , size of sections , segments.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -