powerpc: stub uses new strategy

First mmap must reserve enough space to decompress folded stub.
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	also .h, .map, .dump
This commit is contained in:
John Reiser
2017-10-02 20:03:47 -07:00
parent 9e8de4abe5
commit ca7217e717
6 changed files with 565 additions and 622 deletions
@@ -14,11 +14,10 @@ Idx Name Size VMA LMA File off Algn Flags
9 NRV_TAIL 0000001c 00000000 00000000 00001788 2**0 CONTENTS, READONLY
10 CFLUSH 00000024 00000000 00000000 000017a4 2**0 CONTENTS, READONLY
11 ELFMAINY 00000012 00000000 00000000 000017c8 2**0 CONTENTS, RELOC, READONLY
12 ELFMAINZ 00000204 00000000 00000000 000017da 2**0 CONTENTS, RELOC, READONLY
12 ELFMAINZ 0000017c 00000000 00000000 000017dc 2**2 CONTENTS, RELOC, READONLY
SYMBOL TABLE:
00000000 l d LZMA_DEC30 00000000 LZMA_DEC30
00000000 l d NRV_TAIL 00000000 NRV_TAIL
00000000 l d ELFMAINY 00000000 ELFMAINY
00000000 l d ELFMAINZ 00000000 ELFMAINZ
00000000 l d ELFMAINX 00000000 ELFMAINX
00000000 l d NRV_HEAD 00000000 NRV_HEAD
@@ -29,12 +28,13 @@ SYMBOL TABLE:
00000000 l d LZMA_DEC10 00000000 LZMA_DEC10
00000000 l d LZMA_DEC20 00000000 LZMA_DEC20
00000000 l d CFLUSH 00000000 CFLUSH
00000000 l d ELFMAINY 00000000 ELFMAINY
00000000 g ELFMAINX 00000000 _start
00000000 *UND* 00000000 O_BINFO
RELOCATION RECORDS FOR [ELFMAINX]:
OFFSET TYPE VALUE
00000000 R_PPC_REL24 ELFMAINZ+0x000001bc
00000000 R_PPC_REL24 ELFMAINZ+0x00000134
RELOCATION RECORDS FOR [NRV2E]:
OFFSET TYPE VALUE
@@ -58,6 +58,4 @@ OFFSET TYPE VALUE
RELOCATION RECORDS FOR [ELFMAINZ]:
OFFSET TYPE VALUE
0000007c R_PPC_REL14 ELFMAINY
0000011c R_PPC_REL14 ELFMAINY
00000200 R_PPC_ADDR32 O_BINFO
00000178 R_PPC_ADDR32 O_BINFO
+21 -21
View File
@@ -9,34 +9,34 @@ Linker script and memory map
TARGET(elf32-powerpc)
0x0000000000100080 . = ((0x100000 + SIZEOF_HEADERS) + 0xc)
.text 0x0000000000100080 0xfdc
.text 0x0000000000100080 0xfc8
*(.text)
.text 0x0000000000100080 0x264 tmp/powerpc-linux.elf-fold.o
.text 0x0000000000100080 0x250 tmp/powerpc-linux.elf-fold.o
0x0000000000100080 get_page_mask
0x00000000001002cc munmap
0x000000000010029c readlink
0x0000000000100280 mmap
0x00000000001002a4 write
0x00000000001002ac read
0x00000000001002dc my_bkpt
0x0000000000100294 exit
0x00000000001002d4 brk
0x00000000001002b4 open
0x00000000001002c4 mprotect
0x00000000001002bc close
.text 0x00000000001002e4 0xd78 tmp/powerpc-linux.elf-main.o
0x0000000000100e54 upx_main
0x00000000001002b8 munmap
0x0000000000100288 readlink
0x000000000010026c mmap
0x0000000000100290 write
0x0000000000100298 read
0x00000000001002c8 my_bkpt
0x0000000000100280 exit
0x00000000001002c0 brk
0x00000000001002a0 open
0x00000000001002b0 mprotect
0x00000000001002a8 close
.text 0x00000000001002d0 0xd78 tmp/powerpc-linux.elf-main.o
0x0000000000100e40 upx_main
*(.data)
.data 0x000000000010105c 0x0 tmp/powerpc-linux.elf-fold.o
.data 0x000000000010105c 0x0 tmp/powerpc-linux.elf-main.o
.data 0x0000000000101048 0x0 tmp/powerpc-linux.elf-fold.o
.data 0x0000000000101048 0x0 tmp/powerpc-linux.elf-main.o
.data
.bss 0x000000000010105c 0x0
.bss 0x000000000010105c 0x0 tmp/powerpc-linux.elf-fold.o
.bss 0x000000000010105c 0x0 tmp/powerpc-linux.elf-main.o
.bss 0x0000000000101048 0x0
.bss 0x0000000000101048 0x0 tmp/powerpc-linux.elf-fold.o
.bss 0x0000000000101048 0x0 tmp/powerpc-linux.elf-main.o
.rela.dyn 0x000000000010105c 0x0
.rela.dyn 0x0000000000101048 0x0
.rela.text 0x0000000000000000 0x0 tmp/powerpc-linux.elf-fold.o
LOAD tmp/powerpc-linux.elf-fold.o
LOAD tmp/powerpc-linux.elf-main.o