aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-04-25 01:17:11 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-04-25 01:17:11 +0400
commitb9fd67b38e588685eda6275160cc285652bf9d42 (patch)
treeab1b4b66b72ad6b0302cba2ac2ce8adebf2bfe86
parentbb196d4fd31f147c177e5ed28b9ad82718248daa (diff)
downloadnasm-test-b9fd67b38e588685eda6275160cc285652bf9d42.tar.gz
nasm-test-b9fd67b38e588685eda6275160cc285652bf9d42.tar.xz
nasm-test-b9fd67b38e588685eda6275160cc285652bf9d42.zip
outieee: Implement sectalign handler
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--output/outieee.c24
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,