mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Removed last dependency on nasm assembler.
This commit is contained in:
parent
def1ccffc4
commit
1c3f3b5705
|
@ -134,14 +134,14 @@ tc.default.m-objdump = multiarch-objdump-2.17 $(if $(tc_bfdname),-b $(tc_bfdnam
|
|||
tc.default.m-ld = multiarch-ld-2.17 $(if $(tc_bfdname),-b $(tc_bfdname))
|
||||
tc.default.m-nm = multiarch-nm-2.17 $(if $(tc_bfdname),--target=$(tc_bfdname))
|
||||
tc.default.m-readelf = multiarch-readelf-2.17
|
||||
tc.default.nasm = nasm
|
||||
tc.default.nasm += -I$(srcdir)/ -I$(srcdir)/src/
|
||||
tc.default.nasm += -O99 -w+macro-params -w+macro-selfref -w+number-overflow -w+orphan-labels
|
||||
tc.default.nasm += -Dstub_$(subst .,_,$(subst -,_,$(basename $(notdir $@))))=1
|
||||
##tc.default.nasm = nasm
|
||||
##tc.default.nasm += -I$(srcdir)/ -I$(srcdir)/src/
|
||||
##tc.default.nasm += -O99 -w+macro-params -w+macro-selfref -w+number-overflow -w+orphan-labels
|
||||
##tc.default.nasm += -Dstub_$(subst .,_,$(subst -,_,$(basename $(notdir $@))))=1
|
||||
tc.default.o2bin = perl $(top_srcdir)/src/stub/scripts/o2bin.pl
|
||||
##tc.default.pp-asm = i386-linux-gcc-2.95.3 -E -nostdinc -x assembler-with-cpp -Wall -Wp,-P,-C,-traditional
|
||||
tc.default.pp-asm = i386-linux-gcc-3.4.6 -E -nostdinc -x assembler-with-cpp -Wall
|
||||
tc.default.pp-nasm = $(tc.default.gpp_inc) --mode=nasm -I$(srcdir)/ -I$(srcdir)/src/
|
||||
##tc.default.pp-nasm = $(tc.default.gpp_inc) --mode=nasm -I$(srcdir)/ -I$(srcdir)/src/
|
||||
tc.default.sstrip = sstrip
|
||||
|
||||
# some common settings for $(tc_list)
|
||||
|
@ -522,8 +522,8 @@ tmp/i386-linux.elf.execve-main.o : $(srcdir)/src/$$T.c
|
|||
$(call tc,gcc) -c $< -o $@
|
||||
$(call tc,objstrip) $@
|
||||
|
||||
tmp/i386-linux.elf.execve-upx_itoa.o: $(srcdir)/src/$$T.asm
|
||||
$(call tc,nasm) -f elf -l $@.lst $< -o $@
|
||||
tmp/i386-linux.elf.execve-upx_itoa.o: $(srcdir)/src/$$T.S
|
||||
$(call tc,gcc) -c -x assembler-with-cpp $< -o $@
|
||||
$(call tc,objstrip) $@
|
||||
|
||||
|
||||
|
|
57
src/stub/src/arch/i386/upx_itoa.S
Normal file
57
src/stub/src/arch/i386/upx_itoa.S
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
; upx_itoa.asm -- decimal print; smaller than gcc, and no relocations
|
||||
;
|
||||
; This file is part of the UPX executable compressor.
|
||||
;
|
||||
; Copyright (C) 2002-2006 John F. Reiser
|
||||
; All Rights Reserved.
|
||||
;
|
||||
; UPX and the UCL library are free software; you can redistribute them
|
||||
; and/or modify them under the terms of the GNU General Public License as
|
||||
; published by the Free Software Foundation; either version 2 of
|
||||
; the License, or (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program; see the file COPYING.
|
||||
; If not, write to the Free Software Foundation, Inc.,
|
||||
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
;
|
||||
; John F. Reiser
|
||||
; <jreiser@users.sourceforge.net>
|
||||
;
|
||||
*/
|
||||
|
||||
|
||||
.globl upx_itoa
|
||||
|
||||
upx_itoa: // char *upx_itoa(eax= unsigned v, edx= char *buf) /* 0<=(int)v */
|
||||
push edi // save register
|
||||
mov edi,edx // output ptr
|
||||
push 10
|
||||
cld
|
||||
pop ecx // radix
|
||||
call recur
|
||||
mov [edi],ah // NUL terminate
|
||||
xchg eax,edi // eax= continuation point
|
||||
pop edi // restore register
|
||||
ret
|
||||
recur:
|
||||
cdq // zero extend eax into edx [use "sub edx,edx" if eax < 0 ]
|
||||
div ecx // eax=quo, edx=rem; flags are undefined
|
||||
push edx
|
||||
test eax,eax
|
||||
je quo0
|
||||
call recur
|
||||
quo0:
|
||||
pop eax // remainder
|
||||
add al, '0'
|
||||
stosb
|
||||
ret
|
||||
|
||||
|
||||
// vi:ts=8:et:nowrap
|
2
src/stub/src/i386-linux.elf.execve-upx_itoa.S
Normal file
2
src/stub/src/i386-linux.elf.execve-upx_itoa.S
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include "arch/i386/macros2.ash"
|
||||
#include "arch/i386/upx_itoa.S"
|
|
@ -1 +0,0 @@
|
|||
%include "arch/i386/upx_itoa.ash"
|
Loading…
Reference in New Issue
Block a user