mirror of
https://github.com/upx/upx.git
synced 2026-05-07 20:12:50 +00:00
Cleanup large rebase
modified: README.SRC modified: src/stub/Makefile modified: src/stub/src/arch/i086/cleanasm.py modified: src/stub/src/upxfd_linux.c
This commit is contained in:
@@ -87,7 +87,6 @@ Developer quick start
|
|||||||
# # apt-get update
|
# # apt-get update
|
||||||
# # apt-get install zlib1g-dev:i386 libc6-dev:i386
|
# # apt-get install zlib1g-dev:i386 libc6-dev:i386
|
||||||
# # apt-get install crossbuild-essential-riscv64 # for example
|
# # apt-get install crossbuild-essential-riscv64 # for example
|
||||||
|
|
||||||
# aarch64-linux-gnu/4.9.2/cc1 needs libmpfr.so.4. Make a symlink:
|
# aarch64-linux-gnu/4.9.2/cc1 needs libmpfr.so.4. Make a symlink:
|
||||||
# # ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
|
# # ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -2234,24 +2234,30 @@ riscv64-linux.elf-fold.h : $(srcdir)/src/$$T.lds \
|
|||||||
$(call tc,bin2h) tmp/$T.bin $@
|
$(call tc,bin2h) tmp/$T.bin $@
|
||||||
|
|
||||||
tmp/riscv64-linux.elf-fold.o : $(srcdir)/src/$$T.S
|
tmp/riscv64-linux.elf-fold.o : $(srcdir)/src/$$T.S
|
||||||
$(call tc,gcc) -c $< -o $@
|
$(call tc,gcc) -c -O $< -o $@
|
||||||
$(call tc,f-objstrip,$@)
|
$(call tc,f-objstrip,$@)
|
||||||
|
|
||||||
tmp/riscv64-linux.elf-main2.o : $(srcdir)/src/$$T.c $(srcdir)/src/i386-linux.elf-main2.c
|
tmp/riscv64-linux.elf-main2.o : $(srcdir)/src/$$T.c $(srcdir)/src/i386-linux.elf-main2.c
|
||||||
$(call tc,gcc) -c $< -o $@
|
(echo '#define call jal'; $(call tc,gcc) -S $< -o -) \
|
||||||
|
| sed 's/@plt//' \
|
||||||
|
| $(call tc,gcc) -c -x assembler-with-cpp - -o $@
|
||||||
|
$(call tc,gpp_mkdep) --mode=c --MMD=$@ --MF=tmp/$T.d $<
|
||||||
$(call tc,f-objstrip,$@)
|
$(call tc,f-objstrip,$@)
|
||||||
|
|
||||||
tmp/riscv64-linux.elf-help_umf.o: $(srcdir)/src/$$T.S
|
tmp/riscv64-linux.elf-help_umf.o: $(srcdir)/src/$$T.S
|
||||||
$(call tc,gcc) -c $< -o $@
|
$(call tc,gcc) -c $< -o $@
|
||||||
|
|
||||||
tmp/riscv64-linux.elf-upxfd_linux.o : $(srcdir)/src/upxfd_linux.c
|
tmp/riscv64-linux.elf-upxfd_linux.o : $(srcdir)/src/upxfd_linux.c
|
||||||
$(call tc,gcc) -c $< -o $@
|
(echo '#define call jal'; $(call tc,gcc) -S -O $< -o -) \
|
||||||
|
| sed 's/@plt//' \
|
||||||
|
| $(call tc,gcc) -c -x assembler-with-cpp - -o $@
|
||||||
$(call tc,objcopy) --strip-unneeded --rename-section .text=UMF_LINUX \
|
$(call tc,objcopy) --strip-unneeded --rename-section .text=UMF_LINUX \
|
||||||
-R .riscv.attributes -R .data -R .bss -R .note.GNU-stack $@
|
-R .riscv.attributes -R .data -R .bss -R .note.GNU-stack $@
|
||||||
$(call tc,objdump) -Dr $(tc_objdump_disasm_options) $@ | $(RTRIM) > $@.disasm
|
$(call tc,objdump) -Dr $(tc_objdump_disasm_options) $@ | $(RTRIM) > $@.disasm
|
||||||
|
|
||||||
tmp/riscv64-expand.o: $(srcdir)/src/$$T.S
|
tmp/riscv64-expand.o: $(srcdir)/src/$$T.S
|
||||||
$(call tc,gcc) -c $< -o $@
|
$(call tc,gcc) -c $< -o $@
|
||||||
|
$(call tc,objcopy) -R .riscv.attributes $@
|
||||||
# =====
|
# =====
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
|||||||
@@ -99,11 +99,11 @@ def main(argv):
|
|||||||
k, v = m.group(1).strip(), [0, 0, None, 0]
|
k, v = m.group(1).strip(), [0, 0, None, 0]
|
||||||
assert k and v, (inst, args)
|
assert k and v, (inst, args)
|
||||||
v[2] = k # new name
|
v[2] = k # new name
|
||||||
if k in labels:
|
if labels.has_key(k):
|
||||||
assert labels[k][:2] == v[:2]
|
assert labels[k][:2] == v[:2]
|
||||||
return k, v
|
return k, v
|
||||||
def add_label(k, v):
|
def add_label(k, v):
|
||||||
if k in labels:
|
if labels.has_key(k):
|
||||||
assert labels[k][:2] == v[:2]
|
assert labels[k][:2] == v[:2]
|
||||||
else:
|
else:
|
||||||
labels[k] = v
|
labels[k] = v
|
||||||
@@ -449,7 +449,7 @@ def main(argv):
|
|||||||
ofp = open(ofile, "wb")
|
ofp = open(ofile, "wb")
|
||||||
current_label = None
|
current_label = None
|
||||||
for label, inst, args, args_label in olines:
|
for label, inst, args, args_label in olines:
|
||||||
if label in labels:
|
if labels.has_key(label):
|
||||||
current_label = labels[label][2]
|
current_label = labels[label][2]
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
ofp.write("%s: /* %d */\n" % (labels[label][2], labels[label][3]))
|
ofp.write("%s: /* %d */\n" % (labels[label][2], labels[label][3]))
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ extern void my_bkpt(void const *, ...);
|
|||||||
#define ANDROID_FRIEND 0
|
#define ANDROID_FRIEND 0
|
||||||
#define addr_string(string) ({ \
|
#define addr_string(string) ({ \
|
||||||
char const *str; \
|
char const *str; \
|
||||||
asm("jal 0f; .string \"" string "\"; .balign 4; 0: mv %0,ra" \
|
asm("jal %0,0f; .string \"" string "\"; .balign 4; 0:" \
|
||||||
/*out*/ : "=r"(str) \
|
/*out*/ : "=r"(str) \
|
||||||
/* in*/ : \
|
/* in*/ : \
|
||||||
/*und*/ : ); \
|
/*und*/ : ); \
|
||||||
|
|||||||
Reference in New Issue
Block a user