mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
arm/pe: use embed_objinfo in the Makefile
made some symbols globals in arm.v4a-wince.pe.S & arm.v4t-wince.pe.S
This commit is contained in:
parent
c19ffafd8d
commit
d76ef8e3cf
|
@ -265,26 +265,12 @@ arm.v4t-wince.pe% : tc_bfdname = elf32-littlearm
|
|||
|
||||
arm.v4a-wince.pe.h : $(srcdir)/src/$$T.S
|
||||
$(call tc,gcc) -march=armv4 -c $< -o tmp/$T.bin
|
||||
ifeq (1,1)
|
||||
$(call tc,m-objcopy) -R .text -R .data -R .bss tmp/$T.bin
|
||||
$(call tc,m-objcopy) -R .note -R .comment tmp/$T.bin
|
||||
$(call tc,m-objdump) -trwh tmp/$T.bin >> tmp/$T.bin
|
||||
else
|
||||
# FIXME: can we use --strip-unneeded on arm ??
|
||||
$(call tc,embed_objinfo,tmp/$T.bin)
|
||||
endif
|
||||
$(call tc,bin2h) --ident=nrv_loader_arm tmp/$T.bin $@
|
||||
|
||||
arm.v4t-wince.pe.h : $(srcdir)/src/$$T.S
|
||||
$(call tc,gcc) -march=armv4t -c $< -o tmp/$T.bin
|
||||
ifeq (1,1)
|
||||
$(call tc,m-objcopy) -R .text -R .data -R .bss tmp/$T.bin
|
||||
$(call tc,m-objcopy) -R .note -R .comment tmp/$T.bin
|
||||
$(call tc,m-objdump) -trwh tmp/$T.bin >> tmp/$T.bin
|
||||
else
|
||||
# FIXME: can we use --strip-unneeded on arm ??
|
||||
$(call tc,embed_objinfo,tmp/$T.bin)
|
||||
endif
|
||||
$(call tc,bin2h) --ident=nrv_loader_thumb tmp/$T.bin $@
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -55,6 +55,18 @@
|
|||
|
||||
#define section .section
|
||||
|
||||
// p_armpe.cpp uses the following symbols, so they should be global
|
||||
|
||||
.globl SRC0
|
||||
.globl DST0
|
||||
.globl IATT
|
||||
.globl ENTR
|
||||
.globl FIBS
|
||||
.globl FIBE
|
||||
.globl BREL
|
||||
.globl BIMP
|
||||
.globl ONAM
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
.arm
|
||||
|
|
|
@ -29,6 +29,11 @@
|
|||
<jreiser@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
// p_armpe.cpp uses some symbols, so they should be global
|
||||
// in thumb mode we need this S() macro hack to export a symbol which
|
||||
// is used in an ldr statement
|
||||
#define S(sym) .globl sym; sym: .L##sym
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
#define section .section
|
||||
|
@ -65,12 +70,12 @@ section ExeStart
|
|||
ldr ip, ENTR
|
||||
bx ip
|
||||
|
||||
SRC0: .long start_of_compressed
|
||||
S(SRC0):.long start_of_compressed
|
||||
SRCL: .long compressed_length
|
||||
DST0: .long start_of_uncompressed
|
||||
S(DST0):.long start_of_uncompressed
|
||||
DSTL: .long uncompressed_length
|
||||
IATT: .long 0, 0, 0, 0
|
||||
ENTR: .long original_entry
|
||||
S(IATT):.long 0, 0, 0, 0
|
||||
S(ENTR):.long original_entry
|
||||
|
||||
.thumb
|
||||
|
||||
|
@ -89,9 +94,9 @@ section Unfilter_0x50
|
|||
addval .req r2
|
||||
bufend .req r4
|
||||
|
||||
ldr buffer, FIBS
|
||||
ldr buffer, .LFIBS
|
||||
mov addval, #0
|
||||
ldr bufend, FIBE
|
||||
ldr bufend, .LFIBE
|
||||
mov r5, #0x0f
|
||||
mov r6, #0xff
|
||||
lsl r6, #24
|
||||
|
@ -122,8 +127,8 @@ section Unfilter_0x50
|
|||
.unreq bufend
|
||||
|
||||
.align 2
|
||||
FIBS: .long filter_buffer_start
|
||||
FIBE: .long filter_buffer_end
|
||||
S(FIBS):.long filter_buffer_start
|
||||
S(FIBE):.long filter_buffer_end
|
||||
|
||||
.Luf50_ret:
|
||||
|
||||
|
@ -134,7 +139,7 @@ section Relocs
|
|||
dest .req r1
|
||||
addval .req r2
|
||||
|
||||
ldr buffer, BREL
|
||||
ldr buffer, .LBREL
|
||||
mov addval, dst0
|
||||
sub dest, addval, #4
|
||||
|
||||
|
@ -173,7 +178,7 @@ section Relocs
|
|||
b .Lreloc_loop
|
||||
|
||||
.align 2
|
||||
BREL: .long start_of_relocs
|
||||
S(BREL):.long start_of_relocs
|
||||
|
||||
.Lreloc_end:
|
||||
|
||||
|
@ -190,13 +195,13 @@ section Imports
|
|||
sub sp, #508
|
||||
sub sp, #508
|
||||
sub sp, #508
|
||||
ldr imp, BIMP
|
||||
ldr imp, .LBIMP
|
||||
.Lhi_loop1:
|
||||
mov r0, imp
|
||||
bl get_le32
|
||||
beq .Lhi_end
|
||||
|
||||
ldr r1, ONAM
|
||||
ldr r1, .LONAM
|
||||
add r0, r1
|
||||
mov r1, sp
|
||||
.Lhi_copyname:
|
||||
|
@ -265,8 +270,8 @@ LoadLibraryW:
|
|||
GetProcAddressA:
|
||||
bx r11
|
||||
|
||||
BIMP: .long start_of_imports
|
||||
ONAM: .long start_of_dll_names
|
||||
S(BIMP):.long start_of_imports
|
||||
S(ONAM):.long start_of_dll_names
|
||||
|
||||
.Lhi_end:
|
||||
mov sp, r7
|
||||
|
|
Loading…
Reference in New Issue
Block a user