From b9fd67b38e588685eda6275160cc285652bf9d42 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 25 Apr 2010 01:17:11 +0400 Subject: [PATCH] outieee: Implement sectalign handler Signed-off-by: Cyrill Gorcunov --- output/outieee.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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, -- 2.11.4.GIT