~ubuntu-branches/debian/sid/upx-ucl/sid

« back to all changes in this revision

Viewing changes to src/stub/src/arm-linux.elf-fold.S

  • Committer: Bazaar Package Importer
  • Author(s): Robert Luberda
  • Date: 2009-10-16 12:56:47 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20091016125647-vity1npel2qsmr9c
Tags: 3.04-1
* New upstream release:
  + FTBFS with gcc 4.4 fixed by upstream (closes: #548566).
* p_mach.cpp: Fix from upstream vcs: mach/fat needs seek() 
  after set_extent().

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
@
3
3
@  This file is part of the UPX executable compressor.
4
4
@
5
 
@  Copyright (C) 2000-2008 John F. Reiser
 
5
@  Copyright (C) 2000-2009 John F. Reiser
6
6
@  All Rights Reserved.
7
7
@
8
8
@  UPX and the UCL library are free software; you can redistribute them
27
27
@  <jreiser@users.sourceforge.net>
28
28
@
29
29
 
 
30
#define ARM_OLDABI 1
30
31
#include "arch/arm/v4a/macros.S"
31
32
 
32
33
sz_Elf32_Ehdr = 13*4
123
124
        .unreq cto
124
125
        .unreq fid
125
126
 
 
127
__NR_exit  =  1 + __NR_SYSCALL_BASE
 
128
__NR_read  =  3 + __NR_SYSCALL_BASE
 
129
__NR_write =  4 + __NR_SYSCALL_BASE
 
130
__NR_open  =  5 + __NR_SYSCALL_BASE
 
131
__NR_close =  6 + __NR_SYSCALL_BASE
 
132
__NR_brk   = 45 + __NR_SYSCALL_BASE
 
133
 
 
134
__NR_mmap2    = 192 + __NR_SYSCALL_BASE
 
135
__NR_mprotect = 125 + __NR_SYSCALL_BASE
 
136
__NR_munmap   =  91 + __NR_SYSCALL_BASE
 
137
 
126
138
        .globl exit
127
139
exit:
128
 
        swi 0x00900001
 
140
        do_sys __NR_exit
129
141
 
130
142
        .globl read
131
143
read:
132
 
        swi 0x00900003; mov pc,lr
 
144
        do_sys __NR_read; ret
133
145
 
134
146
        .globl write
135
147
write:
136
 
        swi 0x00900004; mov pc,lr
 
148
        do_sys __NR_write; ret
137
149
 
138
150
        .globl open
139
151
open:
140
 
        swi 0x00900005; mov pc,lr
 
152
        do_sys __NR_open; ret
141
153
 
142
154
        .globl close
143
155
close:
144
 
        swi 0x00900006; mov pc,lr
 
156
        do_sys __NR_close; ret
145
157
 
146
158
        .globl brk
147
159
brk:
148
 
        swi 0x0090002d; mov pc,lr
 
160
        do_sys __NR_brk; ret
149
161
 
150
162
        .globl munmap
151
163
munmap:
152
 
        swi 0x0090005b; mov pc,lr
 
164
        do_sys __NR_munmap; ret
153
165
 
154
166
        .globl mprotect
155
167
mprotect:
156
 
        swi 0x0090007d; mov pc,lr
 
168
        do_sys __NR_mprotect; ret
157
169
 
158
170
        .globl mmap
159
171
mmap:
160
172
        str r5,[sp,#-4]!; ldr r5,[sp,#4+4]
161
173
        str r4,[sp,#-4]!; ldr r4,[sp,#4+4]
162
174
        mov r5,r5,lsr #12  @ convert to page number
163
 
        swi 0x009000c0  @ mmap64
 
175
        do_sys __NR_mmap2
164
176
        ldr r4,[sp],#4
165
177
        ldr r5,[sp],#4
166
 
        mov pc,lr
 
178
        ret
167
179
 
168
180
#if 0  /*{ "gcc-3.4 -fPIC" botches string constants when code moves! */
169
181
        .globl STR_0x