Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/patchelf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,11 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()

Elf_Off startOffset = roundUp(fileContents->size(), getPageSize());

fileContents->resize(startOffset + neededSpace, 0);
// In older version of binutils (2.30), readelf would check if the dynamic
// section segment is strictly smaller than the file (and not same size).
// By making it one byte larger, we don't break readelf.
off_t binutilsQuirkPadding = 1;
fileContents->resize(startOffset + neededSpace + binutilsQuirkPadding, 0);

/* Even though this file is of type ET_DYN, it could actually be
an executable. For instance, Gold produces executables marked
Expand Down