mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 04:52:42 -08:00
When scanning the object files for tags, use binary mode.
This commit is contained in:
parent
c57459a6ad
commit
75464d29dd
1 changed files with 8 additions and 7 deletions
|
|
@ -65,9 +65,9 @@ machine."
|
|||
(key (concatenate 'list tag ":"))
|
||||
(string key))
|
||||
(nil)
|
||||
(let ((c (read-char stream nil nil)))
|
||||
(let ((c (read-byte stream nil nil)))
|
||||
(cond ((null c) (return nil))
|
||||
((not (equal c (pop string)))
|
||||
((not (= c (char-code (pop string))))
|
||||
(setf string key))
|
||||
((null string)
|
||||
(return t))))))
|
||||
|
|
@ -76,9 +76,9 @@ machine."
|
|||
(declare (si::c-local))
|
||||
(concatenate 'string
|
||||
(loop with c = t
|
||||
until (or (null (setf c (read-char stream nil nil)))
|
||||
(equal c #\@))
|
||||
collect c)))
|
||||
until (or (null (setf c (read-byte stream nil nil)))
|
||||
(= c #.(char-code #\@)))
|
||||
collect (code-char c))))
|
||||
|
||||
(defun find-init-name (file &key (tag "@EcLtAg"))
|
||||
"Search for the initialization function in an object file. Since the
|
||||
|
|
@ -86,11 +86,12 @@ initialization function in object files have more or less unpredictable
|
|||
names, we store them in a string in the object file. This string is recognized
|
||||
by the TAG it has at the beginning This function searches that tag and retrieves
|
||||
the function name it precedes."
|
||||
(with-open-file (stream file :direction :input)
|
||||
(with-open-file (stream file :direction :input :element-type '(unsigned-byte 8))
|
||||
(cmpnote "Scanning ~S" file)
|
||||
(when (search-tag stream tag)
|
||||
(let ((name (read-name stream)))
|
||||
(cmpnote "Found tag: ~S" name)
|
||||
(cmpnote "Found tag: ~S for ~A" name file)
|
||||
(print name)
|
||||
name))))
|
||||
|
||||
(defun remove-prefix (prefix name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue