diff options
| author | forsyth <forsyth@vitanuova.com> | 2010-04-27 12:51:13 +0100 |
|---|---|---|
| committer | forsyth <forsyth@vitanuova.com> | 2010-04-27 12:51:13 +0100 |
| commit | d67b7dad77bb8aa973dad1f7c3ab0c309b114278 (patch) | |
| tree | 6794120fb327d6de19cf05eed53f80d877781a3e /utils/libmach/qobj.c | |
| parent | 09da2e137d5eb0c940df35d989e4c31ec0654fc4 (diff) | |
20100427-1251
Diffstat (limited to 'utils/libmach/qobj.c')
| -rw-r--r-- | utils/libmach/qobj.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/utils/libmach/qobj.c b/utils/libmach/qobj.c index 5decad08..e5a2222b 100644 --- a/utils/libmach/qobj.c +++ b/utils/libmach/qobj.c @@ -4,6 +4,7 @@ */ #include <lib9.h> #include <bio.h> +#include <mach.h> #include "qc/q.out.h" #include "obj.h" @@ -21,25 +22,33 @@ static void skip(Biobuf*, int); int _isq(char *s) { - return (s[0]&0377) == ANAME /* ANAME */ - && s[1] == D_FILE /* type */ - && s[2] == 1 /* sym */ - && s[3] == '<'; /* name of file */ + return (s[0]&0377) == ANAME /* ANAME */ + && (s[1]&0377) == ANAME>>8 + && s[2] == D_FILE /* type */ + && s[3] == 1 /* sym */ + && s[4] == '<'; /* name of file */ } int _readq(Biobuf *bp, Prog *p) { - int as, n; + int as, n, c; Addr a; - as = Bgetc(bp); /* as */ + as = Bgetc(bp); /* as(low) */ if(as < 0) return 0; + c = Bgetc(bp); /* as(high) */ + if(c < 0) + return 0; + as |= ((c & 0xff) << 8); p->kind = aNone; + p->sig = 0; if(as == ANAME || as == ASIGNAME){ - if(as == ASIGNAME) - skip(bp, 4); /* signature */ + if(as == ASIGNAME){ + Bread(bp, &p->sig, 4); + p->sig = beswal(p->sig); + } p->kind = aName; p->type = type2char(Bgetc(bp)); /* type */ p->sym = Bgetc(bp); /* sym */ @@ -93,6 +102,7 @@ addr(Biobuf *bp) break; case D_SPR: case D_OREG: + case D_DCR: case D_CONST: case D_BRANCH: off = Bgetc(bp); |
