/[cmucl]/src/code/foreign.lisp
ViewVC logotype

Diff of /src/code/foreign.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by pmai, Tue Oct 30 22:14:36 2001 UTC revision 1.35 by pmai, Thu Dec 6 19:15:41 2001 UTC
# Line 25  Line 25 
25  #+hppa (defconstant foreign-segment-start #x10C00000)  #+hppa (defconstant foreign-segment-start #x10C00000)
26  #+hppa (defconstant foreign-segment-size  #x00400000)  #+hppa (defconstant foreign-segment-size  #x00400000)
27    
28  #+(and freebsd x86)  #+(and bsd x86)
29  (defconstant foreign-segment-start #x0E000000)  (defconstant foreign-segment-start #x0E000000)
30  #+(and freebsd x86)  #+(and bsd x86)
31  (defconstant foreign-segment-size  #x02000000)  (defconstant foreign-segment-size  #x02000000)
32    
33  (defvar *previous-linked-object-file* nil)  (defvar *previous-linked-object-file* nil)
# Line 57  Line 57 
57                  (t                  (t
58                   (incf code))))))))                   (incf code))))))))
59    
60  #+(or (and FreeBSD (not elf)) (and sparc (not svr4)))  #+(or OpenBSD (and FreeBSD (not elf)) (and sparc (not svr4)))
61  (alien:def-alien-type exec  (alien:def-alien-type exec
62    (alien:struct nil    (alien:struct nil
63      (magic c-call:unsigned-long)      (magic c-call:unsigned-long)
# Line 216  to skip undefined symbols which don't ha Line 216  to skip undefined symbols which don't ha
216            (unless (eql (aref line 0) #\space)   ; Skip undefined symbols....            (unless (eql (aref line 0) #\space)   ; Skip undefined symbols....
217              (let* ((symbol (subseq line 11))              (let* ((symbol (subseq line 11))
218                     (address (parse-integer line :end 8 :radix 16))                     (address (parse-integer line :end 8 :radix 16))
219                     #+FreeBSD (kind (aref line 9))       ; filter out .o file names                     (kind (aref line 9)) ; filter out .o file names
220                     (old-address (gethash symbol lisp::*foreign-symbols*)))                     (old-address (gethash symbol lisp::*foreign-symbols*)))
221                (unless (or (null old-address) (= address old-address)                (unless (or (null old-address) (= address old-address)
222                            #+FreeBSD (char= kind #\F))                            (char= kind #\F))
223                  (warn "~S moved from #x~8,'0X to #x~8,'0X.~%"                  (warn "~S moved from #x~8,'0X to #x~8,'0X.~%"
224                        symbol old-address address))                        symbol old-address address))
225                (setf (gethash symbol symbol-table) address))))))                (setf (gethash symbol symbol-table) address))))))
# Line 230  to skip undefined symbols which don't ha Line 230  to skip undefined symbols which don't ha
230  ;;; pw-- This seems to work for FreeBSD. The MAGIC field is not tested  ;;; pw-- This seems to work for FreeBSD. The MAGIC field is not tested
231  ;;; for correct file format so it may croak if ld fails to produce the  ;;; for correct file format so it may croak if ld fails to produce the
232  ;;; expected results. It is probably good enough for now.  ;;; expected results. It is probably good enough for now.
233  #+(or (and FreeBSD (not ELF)) (and sparc (not svr4)))  ;;; prm- We assume this works for OpenBSD as well, needs testing...
234    #+(or OpenBSD (and FreeBSD (not ELF)) (and sparc (not svr4)))
235  (defun load-object-file (name)  (defun load-object-file (name)
236    (format t ";;; Loading object file...~%")    (format t ";;; Loading object file...~%")
237    (multiple-value-bind (fd errno) (unix:unix-open name unix:o_rdonly 0)    (multiple-value-bind (fd errno) (unix:unix-open name unix:o_rdonly 0)
# Line 446  to skip undefined symbols which don't ha Line 447  to skip undefined symbols which don't ha
447              (return))              (return))
448            (let* ((symbol (subseq line 11))            (let* ((symbol (subseq line 11))
449                   (address (parse-integer line :end 8 :radix 16))                   (address (parse-integer line :end 8 :radix 16))
450                   #+FreeBSD (kind (aref line 9)) ; filter out .o file names                   #+BSD (kind (aref line 9))     ; filter out .o file names
451                   (old-address (gethash symbol lisp::*foreign-symbols*)))                   (old-address (gethash symbol lisp::*foreign-symbols*)))
452              (unless (or (null old-address) (= address old-address)              (unless (or (null old-address) (= address old-address)
453                          #+FreeBSD (char= kind #\F))                          #+BSD (char= kind #\F))
454                (warn "~S moved from #x~8,'0X to #x~8,'0X.~%"                (warn "~S moved from #x~8,'0X to #x~8,'0X.~%"
455                      symbol old-address address))                      symbol old-address address))
456              (setf (gethash symbol symbol-table) address)))))              (setf (gethash symbol symbol-table) address)))))

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.5