PowerPC 64-bit big-endian

modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/powerpc-linux.elf-entry.h
	new file:   stub/powerpc64-linux.elf-entry.h
	new file:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/scripts/xstrip.py
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	new file:   stub/src/powerpc64-darwin.dylib-entry.S
	new file:   stub/src/powerpc64-darwin.macho-entry.S
	new file:   stub/src/powerpc64-darwin.macho-fold.S
	new file:   stub/src/powerpc64-darwin.macho-main.c
	new file:   stub/src/powerpc64-linux.elf-entry.S
	new file:   stub/src/powerpc64-linux.elf-fold.S
	new file:   stub/src/powerpc64-linux.elf-fold.lds
	new file:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
This commit is contained in:
John Reiser
2017-04-11 19:15:43 -07:00
parent 40b506d2e0
commit 4e05f087f9
29 changed files with 1944 additions and 478 deletions
+92
View File
@@ -135,6 +135,13 @@ STUBS += powerpc64le-linux.elf-entry.h
STUBS += powerpc64le-linux.elf-fold.h
STUBS += powerpc64le-linux.kernel.vmlinux-head.h
STUBS += powerpc64le-linux.kernel.vmlinux.h
#STUBS += powerpc64-darwin.dylib-entry.h
#STUBS += powerpc64-darwin.macho-entry.h
#STUBS += powerpc64-darwin.macho-fold.h
STUBS += powerpc64-linux.elf-entry.h
STUBS += powerpc64-linux.elf-fold.h
#STUBS += powerpc64-linux.kernel.vmlinux-head.h
#STUBS += powerpc64-linux.kernel.vmlinux.h
endif
@@ -1367,6 +1374,15 @@ powerpc64le-darwin.dylib-entry.h : $(srcdir)/src/$$T.S
$(call tc,bin2h) tmp/$T.bin $@
powerpc64-darwin.dylib%.h : tc_list = powerpc64-linux.elf default
powerpc64-darwin.dylib%.h : tc_bfdname = elf64-powerpc
powerpc64-darwin.dylib-entry.h : $(srcdir)/src/$$T.S
$(call tc,gcc) -c $< -o tmp/$T.bin
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h) tmp/$T.bin $@
# /***********************************************************************
# // powerpc64le-darwin.macho
# ************************************************************************/
@@ -1400,6 +1416,34 @@ tmp/powerpc64le-darwin.macho-main.o : $(srcdir)/src/$$T.c
$(call tc,f-objstrip,$@)
powerpc64-darwin.macho%.h : tc_list = powerpc64-darwin.macho powerpc64-linux.elf default
powerpc64-darwin.macho%.h : tc_bfdname = elf64-powerpcbe
tc.powerpc64-darwin.macho.ld = multiarch-ld-2.27 -b $(tc_bfdname)
powerpc64-darwin.macho-entry.h : $(srcdir)/src/$$T.S
$(call tc,gcc) -c $< -o tmp/$T.bin
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h) tmp/$T.bin $@
powerpc64-darwin.macho-fold.h : tmp/$$T.o tmp/powerpc64-darwin.macho-main.o
$(call tc,ld) --no-warn-mismatch --strip-all --oformat binary -Map tmp/$T.map $(filter %.o,$^) -o tmp/$T.bin
chmod a-x tmp/$T.bin
$(call tc,bin2h) tmp/$T.bin $@
tmp/powerpc64-darwin.macho-fold.o : $(srcdir)/src/$$T.S
$(call tc,gcc) -c $< -o $@
$(call tc,f-objstrip,$@)
# Omit -Os because it references _savegpr0_28 and _restgpr0_28 (and *_16 and *_27)
# only 3 times, so sharing the code of those routines saves almost nothing
# (and we would have to write them ourselves.)
# Besides, PowerPC has 31.5 registers (r0 cannot index), which is plenty.
tmp/powerpc64-darwin.macho-main.o : $(srcdir)/src/$$T.c
$(call tc,gcc) -c -O $< -o $@
$(call tc,f-objstrip,$@)
# /***********************************************************************
# // powerpc64le-linux.elf
# ************************************************************************/
@@ -1435,6 +1479,38 @@ tmp/powerpc64le-linux.elf-main.o : $(srcdir)/src/$$T.c
$(call tc,f-objstrip,$@)
powerpc64-linux.elf%.h : tc_list = powerpc64-linux.elf default
powerpc64-linux.elf%.h : tc_bfdname = elf64-powerpc
tc.powerpc64-linux.elf.gcc = powerpc64-linux-gcc-4.9.2 -m64 -mbig-endian -nostdinc -MMD -MT $@
tc.powerpc64-linux.elf.gcc += -fno-exceptions -fno-asynchronous-unwind-tables -fno-stack-protector
tc.powerpc64-linux.elf.gcc += -mno-longcall
tc.powerpc64-linux.elf.gcc += -Wall -W -Wcast-align -Wcast-qual -Wstrict-prototypes -Wwrite-strings -Werror
tc.powerpc64-linux.elf.ld = powerpc64-linux-ld-2.25 -b $(tc_bfdname)
tc.powerpc64-linux.elf.objcopy = multiarch-objcopy-2.27 -F $(tc_bfdname)
tc.powerpc64-linux.elf.objdump = multiarch-objdump-2.27 -b $(tc_bfdname)
powerpc64-linux.elf-entry.h : $(srcdir)/src/$$T.S
$(call tc,gcc) -c $< -o tmp/$T.bin
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h) tmp/$T.bin $@
powerpc64-linux.elf-fold.h : tmp/$$T.o tmp/powerpc64-linux.elf-main.o $(srcdir)/src/$$T.lds
$(call tc,ld) --strip-all -T $(srcdir)/src/$T.lds -Map tmp/$T.map $(filter %.o,$^) -o tmp/$T.bin
$(call tc,f-objstrip,tmp/$T.bin)
$(call tc,sstrip) tmp/$T.bin
$(call tc,bin2h) tmp/$T.bin $@
tmp/powerpc64-linux.elf-fold.o : $(srcdir)/src/$$T.S
$(call tc,gcc) -c $< -o $@
$(call tc,f-objstrip,$@)
tmp/powerpc64-linux.elf-main.o : $(srcdir)/src/$$T.c
$(call tc,gcc) -c -Os $< -o $@
$(call tc,f-objstrip,$@)
# /***********************************************************************
# // powerpc64le-linux.kernel.vmlinux
# // powerpc64le-linux.kernel.vmlinux-head
@@ -1456,6 +1532,22 @@ powerpc64le-linux.kernel.vmlinux-head.h : $(srcdir)/src/$$T.S
$(call tc,bin2h) tmp/$T.bin $@
powerpc64-linux.kernel.vmlinu%.h : tc_list = powerpc64-linux.kernel default
powerpc64-linux.kernel.vmlinu%.h : tc_bfdname = elf64-powerpc
tc.powerpc64-linux.kernel.gcc = $(tc.powerpc64-linux.elf.gcc)
powerpc64-linux.kernel.vmlinu%.h : $(srcdir)/src/$$T.S
$(call tc,gcc) -c -x assembler-with-cpp $< -o tmp/$T.bin
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h-c) tmp/$T.bin $@
powerpc64-linux.kernel.vmlinux-head.h : $(srcdir)/src/$$T.S
$(call tc,gcc) -c -x assembler-with-cpp $< -o tmp/$T.o
$(call tc,objcopy) --output-target binary --only-section .text tmp/$T.o tmp/$T.bin
$(call tc,bin2h) tmp/$T.bin $@
# /***********************************************************************
# // dependencies
# ************************************************************************/