You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PHDR segment not covered by a LOAD segment after repeated rewrites #675
Patching an ET_EXEC twice with master (3e996db) leaves the program header table outside its LOAD segment, and on aarch64 the next rewrite aborts.
x86_64: after --add-needed, readelf -l says the PHDR segment is not covered by a LOAD segment. The next --add-rpath doesn't fix it.
aarch64: same readelf error after --add-needed, then --add-rpath dies with Assertion 'curOff == neededSpace' failed.
Both findLoadSegmentByOffset() calls in rewriteSectionsExecutable() pass the offset right after the program header table (headerEnd, later curOff). A header LOAD that ends at or before that offset isn't found, so it's neither reused nor extended.
x86_64: readelf -lW: Error: the PHDR segment is not covered by a LOAD segment
aarch64: readelf -lW: Error: the PHDR segment is not covered by a LOAD segment
patchelf: patchelf.cc:1243: ...: Assertion `curOff == neededSpace' failed.
Expected behavior
readelf -l should be clean after every step and repeated rewrites shouldn't abort.
Activity
Find the header LOAD by the start of the program header table
Find the header LOAD by the start of the program header table