diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-04-25 01:17:11 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-04-25 01:17:11 +0400 |
commit | b9fd67b38e588685eda6275160cc285652bf9d42 (patch) | |
tree | ab1b4b66b72ad6b0302cba2ac2ce8adebf2bfe86 /output | |
parent | bb196d4fd31f147c177e5ed28b9ad82718248daa (diff) | |
download | nasm-b9fd67b38e588685eda6275160cc285652bf9d42.tar.gz |
outieee: Implement sectalign handler
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r-- | output/outieee.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/output/outieee.c b/output/outieee.c index d4432719..c5c04135 100644 --- a/output/outieee.c +++ b/output/outieee.c @@ -843,6 +843,28 @@ static int ieee_directive(enum directives directive, char *value, int pass) } } +static void ieee_sectalign(int32_t seg, unsigned int value) +{ + struct ieeeSection *s; + + list_for_each(s, seghead) { + if (s->index == seg - 1) + break; + } + + /* + * 256 is maximum there, note it may happen + * that align is issued on "absolute" segment + * it's fine since SEG_ABS > 256 and we never + * get escape this test + */ + if (!s || !is_power2(value) || value > 256) + return; + + if ((unsigned int)s->align < value) + s->align = value; +} + /* * Return segment data */ @@ -1501,7 +1523,7 @@ struct ofmt of_ieee = { ieee_out, ieee_deflabel, ieee_segment, - null_sectalign, + ieee_sectalign, ieee_segbase, ieee_directive, ieee_filename, |