summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-01-14 12:23:07 (GMT)
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-01-14 12:23:07 (GMT)
commitdf6243f5558b7fc83937b2c0be1109a01c741942 (patch)
tree9089c36030126c50d0d8dfffd359a7c3ed3774a9 /src
parentbf03aff2ea0951bd9f74fe0a304b4d32141ee42e (diff)
downloadpatchelf-df6243f5558b7fc83937b2c0be1109a01c741942.zip
patchelf-df6243f5558b7fc83937b2c0be1109a01c741942.tar.gz
patchelf-df6243f5558b7fc83937b2c0be1109a01c741942.tar.bz2
In symbol tables, rewrite st_value for STT_SECTION entries
Diffstat (limited to 'src')
-rw-r--r--src/patchelf.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index a4591f1..2c6bec7 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -846,6 +846,10 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
unsigned int newIndex = findSection3(section); // inefficient
//debug("rewriting symbol %d: index = %d (%s) -> %d\n", entry, shndx, section.c_str(), newIndex);
wri(sym->st_shndx, newIndex);
+ /* Rewrite st_value. FIXME: we should do this for all
+ types, but most don't actually change. */
+ if (ELF32_ST_TYPE(rdi(sym->st_info)) == STT_SECTION)
+ wri(sym->st_value, rdi(shdrs[newIndex].sh_addr));
}
}
}