2 * 7obj.c - identify and parse an arm64 object file
11 typedef struct Addr Addr;
18 static Addr addr(Biobuf*);
19 static char type2char(int);
20 static void skip(Biobuf*, int);
25 return s[0] == (ANAME&0xff) /* aslo = ANAME */
26 && s[1] == ((ANAME>>8)&0xff)
27 && s[2] == D_FILE /* type */
28 && s[3] == 1 /* sym */
29 && s[4] == '<'; /* name of file */
33 _read7(Biobuf *bp, Prog *p)
38 as = (uchar)Bgetc(bp); /* as */
39 as |= (uchar)Bgetc(bp)<<8;
40 if(as <= AXXX || as >= ALAST)
44 if(as == ANAME || as == ASIGNAME){
46 Bread(bp, &p->sig, 4);
47 p->sig = leswal(p->sig);
50 p->type = type2char(Bgetc(bp)); /* type */
51 p->sym = Bgetc(bp); /* sym */
65 if(Bread(bp, p->id, n) != n)
73 skip(bp, 5); /* reg(1) lineno(4) */
76 if(a.type != D_OREG || a.name != D_STATIC && a.name != D_EXTERN)
88 a.type = Bgetc(bp); /* a.type */
90 a.sym = Bgetc(bp); /* sym index */
91 a.name = Bgetc(bp); /* sym type */
112 off |= Bgetc(bp) << 8;
113 off |= Bgetc(bp) << 16;
114 off |= Bgetc(bp) << 24;
117 if(a.sym && (a.name==D_PARAM || a.name==D_AUTO))
137 case D_EXTERN: return 'U';
138 case D_STATIC: return 'b';
139 case D_AUTO: return 'a';
140 case D_PARAM: return 'p';
141 default: return UNKNOWN;
146 skip(Biobuf *bp, int n)