From cfa6c8ddf6b673f786d0e595e3c58d6e3bfadd6c Mon Sep 17 00:00:00 2001 From: John Reiser Date: Mon, 6 Jun 2011 20:00:43 -0700 Subject: [PATCH] Fix ::pack3 for shared library. --- src/p_lx_elf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 16897596..00ebb4ef 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -252,7 +252,7 @@ void PackLinuxElf32::pack3(OutputFile *fo, Filter &ft) set_te32(&elfout.phdr[0].p_memsz, sz_pack2 + lsize); if (0!=xct_off) { // shared library Elf32_Phdr *phdr = phdri; - unsigned off = sz_pack2; + unsigned off = fo->st_size(); unsigned off_init = 0; // where in file unsigned va_init = sz_pack2; // virtual address unsigned rel = 0; @@ -329,7 +329,7 @@ void PackLinuxElf64::pack3(OutputFile *fo, Filter &ft) set_te64(&elfout.phdr[0].p_memsz, sz_pack2 + lsize); if (0!=xct_off) { // shared library Elf64_Phdr *phdr = phdri; - unsigned off = sz_pack2; + unsigned off = fo->st_size(); unsigned off_init = 0; // where in file acc_uint64l_t va_init = sz_pack2; // virtual address acc_uint64l_t rel = 0;