Skip to content

Commit

Permalink
outieee: Implement sectalign handler
Browse files Browse the repository at this point in the history
Signed-off-by: Cyrill Gorcunov <[email protected]>
  • Loading branch information
cyrillos committed Apr 24, 2010
1 parent bb196d4 commit b9fd67b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion output/outieee.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -1501,7 +1523,7 @@ struct ofmt of_ieee = {
ieee_out,
ieee_deflabel,
ieee_segment,
null_sectalign,
ieee_sectalign,
ieee_segbase,
ieee_directive,
ieee_filename,
Expand Down

0 comments on commit b9fd67b

Please sign in to comment.