scc

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

commit c937f394cf20a8d3d5d29539c077e74e4ecd17ab
parent 867b73094d71bf20b2fe72b468f264d652b379ee
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 27 Nov 2017 22:50:32 +0100

[as] Add fill,aligment and len to the section output

Diffstat:
as/as.h | 2++
as/myro.c | 6+++---
as/symbol.c | 2++
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/as/as.h b/as/as.h @@ -95,6 +95,8 @@ struct section { String name; char *mem; unsigned char flags; + unsigned char fill; + unsigned char aligment; TUINT base; TUINT max; TUINT curpc; diff --git a/as/myro.c b/as/myro.c @@ -56,10 +56,10 @@ writesections(FILE *fp) for (sp = seclist; sp; sp = sp->next) { sect.name = sp->name.offset; sect.flags = 0; - sect.fill = 0; - sect.aligment = 0; + sect.fill = sp->fill; + sect.aligment = sp->aligment; sect.offset = off; - sect.len = 0; + sect.len = sp->max - sp->base; off += wrmyrosec(fp, &sect); } diff --git a/as/symbol.c b/as/symbol.c @@ -198,6 +198,8 @@ section(char *name) sec->base = sec->max = sec->pc = sec->curpc = 0; sec->next = seclist; sec->flags = SRELOC|SREAD|SWRITE|SFILE; + sec->fill = 0; + sec->aligment = 0; } return cursec = sec; }