Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/patchelf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 27ffe8ae871e
Choose a base ref
...
head repository: NixOS/patchelf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 60662393ba84
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 21, 2018

  1. Fix issue #66 by ignoring the first section header when sorting, and …

    …not overwriting NOBITS entries.
    ezquat committed Jun 21, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    dywedir Vlad M.
    Copy the full SHA
    52ab908 View commit details

Commits on Mar 6, 2019

  1. Merge pull request #149 from ezquat/fix-66

    Fix issue #66: ignore 0th section header when sorting, don't overwrite NOBITS
    edolstra authored Mar 6, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6066239 View commit details
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/patchelf.cc
5 changes: 3 additions & 2 deletions src/patchelf.cc
Original file line number Diff line number Diff line change
@@ -475,7 +475,7 @@ void ElfFile<ElfFileParamNames>::sortShdrs()
/* Sort the sections by offset. */
CompShdr comp;
comp.elfFile = this;
sort(shdrs.begin(), shdrs.end(), comp);
sort(shdrs.begin() + 1, shdrs.end(), comp);

/* Restore the sh_link mappings. */
for (unsigned int i = 1; i < rdi(hdr->e_shnum); ++i)
@@ -642,7 +642,8 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
for (auto & i : replacedSections) {
std::string sectionName = i.first;
Elf_Shdr & shdr = findSection(sectionName);
memset(contents + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size));
if (shdr.sh_type != SHT_NOBITS)
memset(contents + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size));
}

for (auto & i : replacedSections) {