- Timestamp:
- Jul 19, 2010, 7:43:36 AM (14 years ago)
- File:
-
- 1 edited
-
branches/arm/library/elf.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/arm/library/elf.lisp
r13279 r13986 170 170 171 171 172 172 #+x86-target 173 173 (defun collect-elf-static-functions () 174 174 (collect ((functions)) … … 184 184 )) 185 185 (functions))) 186 187 #+(or arm-target ppc-target) 188 (defun collect-elf-static-functions () 189 (ccl::purify) 190 (multiple-value-bind (pure-low pure-high) 191 (ccl::do-gc-areas (a) 192 (when (eql(ccl::%fixnum-ref a target::area.code) 193 ccl::area-readonly) 194 (return 195 (values (ash (ccl::%fixnum-ref a target::area.low) target::fixnumshift) 196 (ash (ccl::%fixnum-ref a target::area.active) target::fixnumshift))))) 197 (let* ((hash (make-hash-table :test #'eq)) 198 (code-vector-index #+ppc-target 0 #+arm-target 1)) 199 (ccl::%map-lfuns #'(lambda (f) 200 (let* ((code-vector (ccl:uvref f code-vector-index)) 201 (startaddr (+ (ccl::%address-of code-vector) 202 target::misc-data-offset))) 203 (when (and (>= startaddr pure-low) 204 (< startaddr pure-high)) 205 (push f (gethash code-vector hash)))))) 206 (let* ((n 0)) 207 (declare (fixnum n)) 208 (maphash #'(lambda (k v) 209 (declare (ignore k)) 210 (if (null (cdr v)) 211 (incf n))) 212 hash) 213 (let* ((functions ())) 214 (maphash #'(lambda (k v) 215 (declare (ignore k)) 216 (when (null (cdr v)) 217 (push (car v) functions))) 218 hash) 219 (sort functions 220 #'(lambda (x y) 221 (< (ccl::%address-of (uvref x code-vector-index)) 222 (ccl::%address-of (uvref y code-vector-index)))))))))) 186 223 187 224 (defun register-elf-functions (section-number) … … 217 254 (pref p 218 255 #+64-bit-target :<E>lf64_<S>ym.st_value 219 #+32-bit-target :<E>lf32_<S>ym.st_value) (%address-of f) 256 #+32-bit-target :<E>lf32_<S>ym.st_value) 257 #+x86-target (%address-of f) 258 #+ppc-target (- (%address-of (uvref f 0)) (- ppc::fulltag-misc ppc::node-size)) 259 #+arm-target (- (%address-of (uvref f 1)) (- arm::fulltag-misc arm::node-size)) 220 260 (pref p 221 261 #+64-bit-target :<E>lf64_<S>ym.st_size 222 #+32-bit-target :<E>lf32_<S>ym.st_size) (1+ (ash (1- (%function-code-words f)) target::word-shift)))))) 262 #+32-bit-target :<E>lf32_<S>ym.st_size) 263 #+x86-target (1+ (ash (1- (%function-code-words f)) target::word-shift)) 264 #+ppc-target (ash (uvsize (uvref f 0)) ppc::word-shift) 265 #+arm-target (ash (uvsize (uvref f 1)) arm::word-shift) 266 )))) 223 267 224 268 (defun elf-section-index (section) … … 325 369 #+ppc32-target #$EM_PPC 326 370 #+ppc64-target #$EM_PPC64 371 #+arm-target #$EM_ARM 327 372 )) 328 373 (program-header (new-elf-program-header object))
Note:
See TracChangeset
for help on using the changeset viewer.
