scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b64ef1259866bf8d967c6df793bc4fb79c0078ba
parent 0f0f3817a993e617ecc06c1fe2df4f196d399eee
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 26 Jan 2016 22:11:40 +0100

[cc2-intel] Fix .space directive

We have to put always a 0 after allocating any data in bss,
and it menas that we also put a 0 in the case of .space,
where it is not needed. For this reason we need a comma
in the format string or we will have the size multiplied
by 10.

Diffstat:
Mcc2/arch/amd64-sysv/code.c | 2+-
Mcc2/arch/i386-sysv/code.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc2/arch/amd64-sysv/code.c b/cc2/arch/amd64-sysv/code.c @@ -123,7 +123,7 @@ size2asm(Type *tp) s = "\t.quad\t"; break; default: - s = "\t.space\t%llu"; + s = "\t.space\t%llu,"; break; } } diff --git a/cc2/arch/i386-sysv/code.c b/cc2/arch/i386-sysv/code.c @@ -123,7 +123,7 @@ size2asm(Type *tp) s = "\t.quad\t"; break; default: - s = "\t.space\t%llu"; + s = "\t.space\t%llu,"; break; } }