Compute program header flags in rewriteSectionsLibrary #467
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of using fixed flags of RW for the new program header, holding
the replaced sections, check if the write or execute flags is required
by any accompanying section.
If many sections are going to be replaced a more strict method would be
to split them up and add up-to 4 new program headers if necessary:
read-only, read-write, read-execute, read-write-execute.
p.s.:
also the harded flags for executables seems suspicious:
patchelf/src/patchelf.cc
Line 562 in e37f892
Maybe that should be
wri(phdr.p_flags, rdi(phdrs.at(splitIndex).p_flags));
?p.p.s:
Should these lines convert the read data
patchelf/src/patchelf.cc
Lines 558 to 560 in e37f892
e.g.
?