From c749f6760d69f6594a8b84ba8ab195d838766d89 Mon Sep 17 00:00:00 2001 From: Breno Rodrigues Guimaraes Date: Fri, 17 Mar 2023 19:06:12 -0300 Subject: Use a different letter for section tainting --- src/patchelf.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/patchelf.cc b/src/patchelf.cc index 1a90edb..37e6479 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -664,14 +664,14 @@ template void ElfFile::writeReplacedSections(Elf_Off & curOff, Elf_Addr startAddr, Elf_Off startOffset) { - /* Overwrite the old section contents with 'X's. Do this + /* Overwrite the old section contents with 'Z's. Do this *before* writing the new section contents (below) to prevent clobbering previously written new section contents. */ for (auto & i : replacedSections) { const std::string & sectionName = i.first; const Elf_Shdr & shdr = findSectionHeader(sectionName); if (rdi(shdr.sh_type) != SHT_NOBITS) - memset(fileContents->data() + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size)); + memset(fileContents->data() + rdi(shdr.sh_offset), 'Z', rdi(shdr.sh_size)); } std::set noted_phdrs = {}; -- cgit v1.2.1