Compress shared libraries for mips and mipsel in ELF on Linux

modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	new file:   stub/mips.r3000-linux.shlib-init.h
	new file:   stub/mipsel.r3000-linux.shlib-init.h
	new file:   stub/src/mips.r3000-linux.shlib-init.S
	new file:   stub/src/mipsel.r3000-linux.shlib-init.S
	new file:   stub/tmp/mips.r3000-linux.shlib-init.bin.dump
	new file:   stub/tmp/mipsel.r3000-linux.shlib-init.bin.dump
This commit is contained in:
John Reiser
2017-10-19 13:47:36 -07:00
parent ee008acfbd
commit 403b180b1d
8 changed files with 2040 additions and 8 deletions
+44
View File
@@ -117,8 +117,10 @@ STUBS += i386-win32.pe.h
STUBS += m68k-atari.tos.h
STUBS += mips.r3000-linux.elf-entry.h
STUBS += mips.r3000-linux.elf-fold.h
STUBS += mips.r3000-linux.shlib-init.h
STUBS += mipsel.r3000-linux.elf-entry.h
STUBS += mipsel.r3000-linux.elf-fold.h
STUBS += mipsel.r3000-linux.shlib-init.h
STUBS += mipsel.r3000-ps1.h
STUBS += powerpc-darwin.dylib-entry.h
STUBS += powerpc-darwin.macho-entry.h
@@ -1199,6 +1201,27 @@ tmp/mips.r3000-linux.elf-main.o : $(srcdir)/src/$$T.c $(srcdir)/src/i386-linux.e
$(call tc,f-objstrip,$@)
# /***********************************************************************
# // mips.r3000-linux.shlib
# ************************************************************************/
mips.r3000-linux.shlib%.h : tc_list = mips.r3000-linux.elf default
mips.r3000-linux.shlib%.h : tc_bfdname = elf32-bigmips
mips.r3000-linux.shlib%.h : $(srcdir)/src/$$T.S
ifeq (1,1)
# info: we really need as-2.17 here
$(call tc,pp-as) -D_TARGET_LINUX_ -D__MIPSEB__ $< -o - | $(RTRIM) > tmp/$T.i
$(call tc,as) tmp/$T.i -o tmp/$T.bin
$(call tc,gpp_mkdep) --mode=c --MMD=$@ --MF=tmp/$T.d $<
else
# info: as-2.16.1 as used by gcc-4.1.1 does _not_ work
$(call tc,gcc) -c -D_TARGET_LINUX_ -Wa,-O,-mno-pdr $< -o tmp/$T.bin
endif
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h-c) tmp/$T.bin $@
# /***********************************************************************
# // mipsel.r3000-linux.elf
# ************************************************************************/
@@ -1237,6 +1260,27 @@ tmp/mipsel.r3000-linux.elf-main.o : $(srcdir)/src/$$T.c $(srcdir)/src/i386-linux
$(call tc,f-objstrip,$@)
# /***********************************************************************
# // mipsel.r3000-linux.shlib
# ************************************************************************/
mipsel.r3000-linux.shlib%.h : tc_list = mipsel.r3000-ps1 default
mipsel.r3000-linux.shlib%.h : tc_bfdname = elf32-littlemips
mipsel.r3000-linux.shlib%.h : $(srcdir)/src/$$T.S
ifeq (1,1)
# info: we really need as-2.17 here
$(call tc,pp-as) -D_TARGET_LINUX_ -D__MIPSEL__ $< -o - | $(RTRIM) > tmp/$T.i
$(call tc,as) tmp/$T.i -o tmp/$T.bin
$(call tc,gpp_mkdep) --mode=c --MMD=$@ --MF=tmp/$T.d $<
else
# info: as-2.16.1 as used by gcc-4.1.1 does _not_ work
$(call tc,gcc) -c -D_TARGET_LINUX_ -Wa,-O,-mno-pdr $< -o tmp/$T.bin
endif
$(call tc,f-embed_objinfo,tmp/$T.bin)
$(call tc,bin2h-c) tmp/$T.bin $@
# /***********************************************************************
# // mipsel.r3000-ps1
# ************************************************************************/