diff --git a/sys/src/cmd/6l/l.h b/sys/src/cmd/6l/l.h index ef2f436dd..39037c5a2 100644 --- a/sys/src/cmd/6l/l.h +++ b/sys/src/cmd/6l/l.h @@ -354,6 +354,7 @@ vlong entryvalue(void); void errorexit(void); void export(void); int find1(long, int); +int find1v(vlong, int); int find2(long, int); void follow(void); void gethunk(void); diff --git a/sys/src/cmd/6l/obj.c b/sys/src/cmd/6l/obj.c index 8035ae1e9..0353e2c30 100644 --- a/sys/src/cmd/6l/obj.c +++ b/sys/src/cmd/6l/obj.c @@ -1417,12 +1417,14 @@ nuxiinit(void) if(i < 1) inuxi1[i] = c; inuxi4[i] = c; - inuxi8[i] = c; - inuxi8[i+4] = c+4; fnuxi4[i] = c; fnuxi8[i] = c; fnuxi8[i+4] = c+4; } + + for(i=0; i<8; i++) + inuxi8[i] = find1v(0x0807060504030201LL, i+1); + if(debug['v']) { Bprint(&bso, "inuxi = "); for(i=0; i<1; i++) @@ -1460,6 +1462,19 @@ find1(long l, int c) return 0; } +int +find1v(vlong l, int c) +{ + char *p; + int i; + + p = (char*)&l; + for(i=0; i<8; i++) + if(*p++ == c) + return i; + return 0; +} + int find2(long l, int c) {