Place loader immediately after compressed PT_LOADs, in "middle" of file.

This moves compressed gaps and debuginfo out of compressed PT_LOADs,
and fixes a bug where large debuginfo would cause first mmap
at runtime to erase the loader (SourceForge bug 3239079).
This commit is contained in:
John Reiser
2011-03-28 10:44:23 -07:00
parent 54618064a1
commit 836fd2565f
2 changed files with 99 additions and 49 deletions
+2
View File
@@ -75,6 +75,8 @@ protected:
unsigned sz_phdrs; // sizeof Phdr[]
unsigned sz_elf_hdrs; // all Elf headers
unsigned sz_pack2; // after pack2(), before loader
unsigned sz_pack2a; // after pack2() of all PT_LOAD
unsigned sz_pack2b; // after pack2() of all PT_LOAD and gaps
unsigned lg2_page; // log2(PAGE_SIZE)
unsigned page_size; // 1u<<lg2_page
unsigned xct_off; // shared library: file offset of SHT_EXECINSTR