summaryrefslogtreecommitdiff
path: root/utils/6l/obj.c
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2010-04-27 19:13:34 +0100
committerforsyth <forsyth@vitanuova.com>2010-04-27 19:13:34 +0100
commit2303ddadf6e5cbf9705ccf25abe6114af1126b79 (patch)
tree69ba2b94d272fd62869f0ce34703b972e3cf084f /utils/6l/obj.c
parentac618e3d372eaed038e4ca17b28993202bcfab1d (diff)
20100427-1913
Diffstat (limited to 'utils/6l/obj.c')
-rw-r--r--utils/6l/obj.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/utils/6l/obj.c b/utils/6l/obj.c
index 30c39120..9f57d612 100644
--- a/utils/6l/obj.c
+++ b/utils/6l/obj.c
@@ -13,7 +13,8 @@ char *thestring = "amd64";
char *paramspace = "FP";
/*
- * -H2 -T4128 -R4096 is plan9 format
+ * -H2 -T4136 -R4096 is plan9 64-bit format
+ * -H3 -T4128 -R4096 is plan9 32-bit format
* -H5 -T0x80110000 -R4096 is ELF32
*
* options used: 189BLQSWabcjlnpsvz
@@ -122,9 +123,18 @@ main(int argc, char *argv[])
diag("unknown -H option");
errorexit();
case 2: /* plan 9 */
+ HEADR = 32L+8L;
+ if(INITTEXT == -1)
+ INITTEXT = 4096+HEADR;
+ if(INITDAT == -1)
+ INITDAT = 0;
+ if(INITRND == -1)
+ INITRND = 4096;
+ break;
+ case 3: /* plan 9 */
HEADR = 32L;
if(INITTEXT == -1)
- INITTEXT = 1024*1024;
+ INITTEXT = 4096+32;
if(INITDAT == -1)
INITDAT = 0;
if(INITRND == -1)
@@ -500,7 +510,11 @@ zaddr(uchar *p, Adr *a, Sym *h[])
}
a->offset = 0;
if(t & T_OFFSET) {
- l = (long)(p[c] | (p[c+1]<<8) | (p[c+2]<<16) | (p[c+3]<<24));
+ /*
+ * Hack until Charles fixes the compiler.
+ a->offset = (long)(p[c] | (p[c+1]<<8) | (p[c+2]<<16) | (p[c+3]<<24));
+ */
+ l = p[c] | (p[c+1]<<8) | (p[c+2]<<16) | (p[c+3]<<24);
a->offset = l;
c += 4;
if(t & T_64) {