ELF2: Fix EINVAL when PT_LOAD does not start on page boundary
modified: stub/src/amd64-linux.elf-main2.c
modified: ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
plus generated .h .map
This commit is contained in:
Generated
+1019
-1026
File diff suppressed because it is too large
Load Diff
@@ -552,7 +552,10 @@ do_xmap(
|
||||
mfd = memfd_create(addr_string("upx"), 0); // the directory entry
|
||||
ftruncate(mfd, mlen); // Allocate the pages in the file.
|
||||
if (frag) {
|
||||
write(mfd, addr, frag); // Save lo fragment of contents on first page.
|
||||
// Note: *addr does not exist yet, and figuring out a substitute
|
||||
// Note: location is a cumbersome heristic. So do not attempt.
|
||||
//
|
||||
// write(mfd, addr, frag); // Save lo fragment of contents on first page.
|
||||
}
|
||||
if (addr != mmap(addr, mlen, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_SHARED, mfd, 0)) {
|
||||
err_exit(7);
|
||||
|
||||
+3
-3
@@ -8,13 +8,13 @@ Linker script and memory map
|
||||
|
||||
0x000000000010004c . = ((0x100000 + SIZEOF_HEADERS) + 0xc)
|
||||
|
||||
.text 0x0000000000000000 0x909
|
||||
.text 0x0000000000000000 0x8f1
|
||||
.text 0x0000000000000000 0x160 tmp/amd64-linux.elf-fold.o
|
||||
0x0000000000000158 get_page_mask
|
||||
.text 0x0000000000000160 0x0 tmp/amd64-expand.o
|
||||
.text 0x0000000000000160 0x7a9 tmp/amd64-linux.elf-main2.o
|
||||
.text 0x0000000000000160 0x791 tmp/amd64-linux.elf-main2.o
|
||||
0x00000000000002b5 underlay
|
||||
0x00000000000007d4 upx_main
|
||||
0x00000000000007bc upx_main
|
||||
|
||||
EXP_HEAD 0x0000000000000000 0xe1
|
||||
EXP_HEAD 0x0000000000000000 0xe1 tmp/amd64-expand.o
|
||||
|
||||
Reference in New Issue
Block a user