summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-24 22:54:26 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-24 22:54:26 +0100
commit8ab9c6d38864362d3683883f22d7539de742cf56 (patch)
tree45d860752688b482c074bc91c3874d4376ef12d4 /sys
parent0a9e7e34ceb24dac229b704d320a53515ddc1855 (diff)
vc: fix coffsect.lnno overflow into nreloc
the coffsect.lnno field is 16 bit and can overflow into the nreloc field confusing arc firmware on load. just mask it to prevent overflow.
Diffstat (limited to 'sys')
-rw-r--r--sys/src/cmd/vl/asm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/src/cmd/vl/asm.c b/sys/src/cmd/vl/asm.c
index 1e7039f1b..c18c5b408 100644
--- a/sys/src/cmd/vl/asm.c
+++ b/sys/src/cmd/vl/asm.c
@@ -314,7 +314,7 @@ asmb(void)
lput(HEADR);
lput(0L);
lput(HEADR+textsize+datsize+symsize);
- lput(lcsize); /* line number size */
+ lput(lcsize & 0xffff); /* line number size */
lput(0x20L); /* flags */
strnput(".data", 8); /* data segment */
@@ -338,7 +338,6 @@ asmb(void)
lput(0x80L); /* flags */
break;
case 4:
-
lput((0x160L<<16)|3L); /* magic and sections */
lput(time(0)); /* time and date */
lput(rnd(HEADR+textsize, 4096)+datsize);
@@ -367,7 +366,7 @@ asmb(void)
lput(HEADR);
lput(0L);
lput(HEADR+textsize+datsize+symsize);
- lput(lcsize); /* line number size */
+ lput(lcsize & 0xffff); /* line number size */
lput(0x20L); /* flags */
strnput(".data", 8); /* data segment */