PowerPC64: stub uses new strategy

Needed: expert on TOC for big-endian.  glibc, musl, gcc disagree
on layout (is the .func first?) and usage for .e_entry.
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/Makefile
	also .h, .bin.dump, .map
This commit is contained in:
John Reiser
2017-10-07 13:43:12 -07:00
parent 7f905724b1
commit b37bc99330
28 changed files with 1542 additions and 1478 deletions
+14 -14
View File
@@ -32,8 +32,8 @@
#define STUB_POWERPC_LINUX_ELF_FOLD_SIZE 4168
#define STUB_POWERPC_LINUX_ELF_FOLD_ADLER32 0x08ac57ce
#define STUB_POWERPC_LINUX_ELF_FOLD_CRC32 0x1e254351
#define STUB_POWERPC_LINUX_ELF_FOLD_ADLER32 0x5c0657c6
#define STUB_POWERPC_LINUX_ELF_FOLD_CRC32 0x9bbd4980
unsigned char stub_powerpc_linux_elf_fold[4168] = {
/* 0x0000 */ 127, 69, 76, 70, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -59,7 +59,7 @@ unsigned char stub_powerpc_linux_elf_fold[4168] = {
/* 0x0140 */ 144, 3, 0, 4,132, 4, 0, 8,148, 3, 0, 8, 64,158,255,236,
/* 0x0150 */ 58,163, 0, 4,126,154,168, 80,128, 22, 0,100, 58,100, 0, 4,
/* 0x0160 */ 148, 3, 0, 4, 58, 67, 0, 4, 56,160, 15,255,126, 68,147,120,
/* 0x0170 */ 56,118, 0,104, 72, 0, 1, 21, 56,178,255,252, 44, 3, 0, 0,
/* 0x0170 */ 56,118, 0,104, 72, 0, 1, 29, 56,178,255,252, 44, 3, 0, 0,
/* 0x0180 */ 65,129, 0, 12, 56,182, 0,100, 56, 96, 0, 16, 56, 99, 0, 4,
/* 0x0190 */ 124,133, 26, 20,124,105, 3,166,126, 99,155,120, 56,160, 0, 0,
/* 0x01a0 */ 156,163,255,255,140, 4,255,255,156, 3,255,255, 66, 0,255,248,
@@ -71,16 +71,16 @@ unsigned char stub_powerpc_linux_elf_fold[4168] = {
/* 0x0200 */ 127, 41,203,120, 72, 0, 12, 61, 56, 33, 8, 16,124,127, 27,120,
/* 0x0210 */ 57, 0, 0, 0,127,103,219,120, 56,192, 0, 2, 56,160, 0, 1,
/* 0x0220 */ 124,158, 0,208, 56, 96, 0, 0, 72, 0, 0, 69,127, 99,219,120,
/* 0x0230 */ 72, 0, 0,121,127, 67,211,120,128, 3, 0, 0,128,131, 0, 4,
/* 0x0230 */ 72, 0, 0,129,127, 67,211,120,128, 3, 0, 0,128,131, 0, 4,
/* 0x0240 */ 56, 99, 0, 8, 43,128, 0, 0, 64,158,255,240,124,137, 3,166,
/* 0x0250 */ 127,163,235,120,127,132,227,120, 56, 0, 0, 91,127,232, 3,166,
/* 0x0260 */ 184,161, 0, 32, 56, 33, 0,144, 78,128, 4, 32, 56, 0, 0, 90,
/* 0x0270 */ 68, 0, 0, 2, 64,163, 0, 8, 56, 96,255,255, 78,128, 0, 32,
/* 0x0280 */ 56, 0, 0, 1, 72, 0, 0, 8, 56, 0, 0, 85, 72, 0, 0, 8,
/* 0x0290 */ 56, 0, 0, 4, 72, 0, 0, 8, 56, 0, 0, 3, 72, 0, 0, 8,
/* 0x02a0 */ 56, 0, 0, 5, 72, 0, 0, 8, 56, 0, 0, 6, 72, 0, 0, 8,
/* 0x02b0 */ 56, 0, 0,125, 72, 0, 0, 8, 56, 0, 0, 91, 72, 0, 0, 8,
/* 0x02c0 */ 56, 0, 0, 45, 75,255,255,172,124,128, 0, 8, 78,128, 0, 32,
/* 0x0280 */ 56, 0, 0, 1, 72, 0, 0, 8, 56, 0, 0, 45, 72, 0, 0, 8,
/* 0x0290 */ 56, 0, 0, 85, 72, 0, 0, 8, 56, 0, 0, 4, 72, 0, 0, 8,
/* 0x02a0 */ 56, 0, 0, 3, 72, 0, 0, 8, 56, 0, 0, 5, 72, 0, 0, 8,
/* 0x02b0 */ 56, 0, 0, 6, 72, 0, 0, 8, 56, 0, 0,125, 72, 0, 0, 8,
/* 0x02c0 */ 56, 0, 0, 91, 75,255,255,172,124,128, 0, 8, 78,128, 0, 32,
/* 0x02d0 */ 148, 33,255,208,124, 8, 2,166,147,225, 0, 44,144, 1, 0, 52,
/* 0x02e0 */ 124, 63, 11,120,144,127, 0, 8,144,159, 0, 12,144,191, 0, 16,
/* 0x02f0 */ 129, 63, 0, 8,128, 9, 0, 4,144, 31, 0, 20,128, 31, 0, 12,
@@ -97,7 +97,7 @@ unsigned char stub_powerpc_linux_elf_fold[4168] = {
/* 0x03a0 */ 129, 97, 0, 0,128, 11, 0, 4,124, 8, 3,166,131,235,255,252,
/* 0x03b0 */ 125, 97, 91,120, 78,128, 0, 32,148, 33,255,224,124, 8, 2,166,
/* 0x03c0 */ 147,225, 0, 28,144, 1, 0, 36,124, 63, 11,120,144,127, 0, 8,
/* 0x03d0 */ 128,127, 0, 8, 75,255,254,237,124, 96, 27,120,124, 3, 3,120,
/* 0x03d0 */ 128,127, 0, 8, 75,255,254,181,124, 96, 27,120,124, 3, 3,120,
/* 0x03e0 */ 129, 97, 0, 0,128, 11, 0, 4,124, 8, 3,166,131,235,255,252,
/* 0x03f0 */ 125, 97, 91,120, 78,128, 0, 32,148, 33,255,176,124, 8, 2,166,
/* 0x0400 */ 147,225, 0, 76,144, 1, 0, 84,124, 63, 11,120,144,127, 0, 8,
@@ -247,7 +247,7 @@ unsigned char stub_powerpc_linux_elf_fold[4168] = {
/* 0x0d00 */ 128,159, 0, 48,128,191, 0, 36, 75,255,249, 29,124, 96, 27,120,
/* 0x0d10 */ 144, 31, 0, 88,128, 31, 0, 88, 47,128, 0, 0, 65,158, 0, 20,
/* 0x0d20 */ 128,127, 0, 20, 56,128, 0, 0,128,191, 0, 88, 75,255,250,237,
/* 0x0d30 */ 128,127, 0, 76,128,159, 0, 72,128,191, 0, 56, 75,255,245,117,
/* 0x0d30 */ 128,127, 0, 76,128,159, 0, 72,128,191, 0, 56, 75,255,245,125,
/* 0x0d40 */ 124, 96, 27,120, 47,128, 0, 0, 65,158, 0, 12, 56, 96, 0,127,
/* 0x0d50 */ 75,255,245, 49,129, 63, 0, 72,128, 31, 0, 84,125, 41, 2, 20,
/* 0x0d60 */ 128, 31, 0, 76,124, 0, 74, 20,144, 31, 0, 76,129, 63, 0, 76,
@@ -284,15 +284,15 @@ unsigned char stub_powerpc_linux_elf_fold[4168] = {
/* 0x0f50 */ 127,137, 0, 0, 64,157, 0,212,129, 63, 0, 60,128, 9, 0, 0,
/* 0x0f60 */ 47,128, 0, 3, 64,158, 0,168,129, 63, 0, 60,129, 41, 0, 8,
/* 0x0f70 */ 128, 31, 0, 56,124, 9, 2, 20,124, 3, 3,120, 56,128, 0, 0,
/* 0x0f80 */ 56,160, 0, 0, 75,255,243, 29,124, 96, 27,120,144, 31, 0, 72,
/* 0x0f80 */ 56,160, 0, 0, 75,255,243, 37,124, 96, 27,120,144, 31, 0, 72,
/* 0x0f90 */ 128, 31, 0, 72, 47,128, 0, 0, 64,156, 0, 8, 72, 0, 0, 32,
/* 0x0fa0 */ 128,127, 0, 72,128,159, 0, 16, 56,160, 2, 0, 75,255,242,237,
/* 0x0fa0 */ 128,127, 0, 72,128,159, 0, 16, 56,160, 2, 0, 75,255,242,245,
/* 0x0fb0 */ 124, 96, 27,120, 47,128, 2, 0, 65,158, 0, 12, 56, 96, 0,127,
/* 0x0fc0 */ 75,255,242,193, 56, 31, 0, 56,128,127, 0, 72,128,159, 0, 16,
/* 0x0fd0 */ 56,160, 0, 0,128,223, 0, 20,124, 7, 3,120, 57, 0, 0, 0,
/* 0x0fe0 */ 57, 32, 0, 0, 75,255,250, 81,124, 96, 27,120,144, 31, 0, 64,
/* 0x0ff0 */ 128,127, 0, 20, 56,128, 0, 7,128,191, 0, 56, 75,255,248, 29,
/* 0x1000 */ 128,127, 0, 72, 75,255,242,165, 72, 0, 0, 32,129, 63, 0, 60,
/* 0x1000 */ 128,127, 0, 72, 75,255,242,173, 72, 0, 0, 32,129, 63, 0, 60,
/* 0x1010 */ 56, 9, 0, 32,144, 31, 0, 60,129, 63, 0, 68, 56, 9, 0, 1,
/* 0x1020 */ 144, 31, 0, 68, 75,255,255, 28,128, 31, 0, 64,124, 3, 3,120,
/* 0x1030 */ 129, 97, 0, 0,128, 11, 0, 4,124, 8, 3,166,131,235,255,252,