From d736da4208321acf7f257cdda31e95e04bbb635c Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 28 Jan 2018 13:30:10 -0800 Subject: [PATCH] Elf32, not shared lib: leave alone the hole between .text and .data In theory Linux might put pages there (and that would be a problem), but postpone closing the gap until more experience. modified: p_lx_elf.cpp --- src/p_lx_elf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index b35b641c..e03295bc 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -384,9 +384,10 @@ off_t PackLinuxElf32::pack3(OutputFile *fo, Filter &ft) // between end_text and data, which we wish to prevent // because the expanded program will use that space. // So: pretend 4KiB pages. - unsigned const pm = (Elf64_Ehdr::EM_PPC64 == e_machine) + unsigned pm = (Elf64_Ehdr::EM_PPC64 == e_machine) ? page_mask // reducing to 4KiB DOES NOT WORK ?? : ((~(unsigned)0)<<12); + pm = page_mask; // Revert until consequences can be analyzed v_hole = pm & (~pm + v_hole + get_te32(&elfout.phdr[0].p_vaddr)); set_te32(&elfout.phdr[1].p_vaddr, v_hole); set_te32(&elfout.phdr[1].p_align, ((unsigned)0) - pm);