-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfixes for NixOS/patchelf-compatible saver (#39)
* Bugfixes for NixOS/patchelf-compatible saver * Fix handling of NOTE sections - NixOS/patchelf@43a3348 and subsequent bugfix commits * Fix default page size on some architectures - NixOS/patchelf@0470d69 * Fix corruption if sh_offset and sh_address differs - NixOS/patchelf@83aa89a * Fix corruption with multiple shstrtab sections - NixOS/patchelf@a89d508 * Fix corruption due to incorrect PT_PHDR virtaddr - NixOS/patchelf@4efbce4 * Fix error patching binaries without .gnu.hash - NixOS/patchelf@57fe1d3 * Fix error using debug-only stripped binaries - NixOS/patchelf@64fe89b * Skip blank PT_NOTE segments - Bo98/patchelf@1097751 * Sync .note.gnu.property to PT_GNU_PROPERTY - Bo98/patchelf@de79f1a * Rework file shifting to avoid sections crossing multiple segments - Bo98/patchelf@109b771 * Support LoongArch - NixOS/patchelf@4b87d4f * Support special MIPS sections - NixOS/patchelf@b240bb8, NixOS/patchelf@bf73d6e, NixOS/patchelf@820da7b * Add various tests for alt_saver fixes
- Loading branch information
Showing
12 changed files
with
434 additions
and
57 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
PHDRS | ||
{ | ||
headers PT_PHDR PHDRS ; | ||
notes PT_NOTE; | ||
text PT_LOAD FILEHDR PHDRS ; | ||
data PT_LOAD ; | ||
interp PT_INTERP ; | ||
dynamic PT_DYNAMIC ; | ||
} | ||
|
||
SECTIONS | ||
{ | ||
. = SIZEOF_HEADERS; | ||
. = ALIGN(4); | ||
|
||
.note.my-section0 : { *(.note.my-section0) } :notes :text | ||
.note.my-section1 : { *(.note.my-section1) } :notes :text | ||
|
||
.interp : { *(.interp) } :text :interp | ||
.text : { *(.text) } :text | ||
.rodata : { *(.rodata) } /* defaults to :text */ | ||
|
||
.data : { *(.data) } :data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Testcase for error: | ||
* patchelf: cannot normalize PT_NOTE segment: non-contiguous SHT_NOTE sections | ||
*/ | ||
.section ".note.my-section0", "a", %note | ||
.align 4 | ||
.long 1f - 0f /* name length (not including padding) */ | ||
.long 3f - 2f /* desc length (not including padding) */ | ||
.long 1 /* type = NT_VERSION */ | ||
0: .asciz "my-version-12345" /* name */ | ||
1: .align 4 | ||
2: .long 1 /* desc - toolchain version number, 32-bit LE */ | ||
3: .align 4 | ||
|
||
.section ".note.my-section1", "a", %note | ||
.align 8 | ||
.long 1f - 0f /* name length (not including padding) */ | ||
.long 3f - 2f /* desc length (not including padding) */ | ||
.long 1 /* type = NT_VERSION */ | ||
0: .asciz "my-version-1" /* name */ | ||
1: .align 4 | ||
2: .long 1 /* desc - toolchain version number, 32-bit LE */ | ||
3: .align 4 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters