Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
return 1;
}
+static void bin_sectalign(int32_t seg, unsigned int value)
+{
+ struct Section *s = find_section_by_index(seg);
+
+ if (!s || !is_power2(value))
+ return;
+
+ /*
+ * Extended bin format non-default alignment
+ * is forbidden
+ */
+ if (!format_mode && (!strcmp(s->name, ".text")))
+ return;
+
+ if (value > s->align)
+ s->align = value;
+
+ if (!(s->flags & ALIGN_DEFINED))
+ s->flags |= ALIGN_DEFINED;
+}
+
static void bin_assign_attributes(struct Section *sec, char *astring)
{
int attribute, check;
bin_out,
bin_deflabel,
bin_secname,
- null_sectalign,
+ bin_sectalign,
bin_segbase,
bin_directive,
bin_filename,
bin_out,
bin_deflabel,
bin_secname,
- null_sectalign,
+ bin_sectalign,
bin_segbase,
bin_directive,
ith_filename,
bin_out,
bin_deflabel,
bin_secname,
- null_sectalign,
+ bin_sectalign,
bin_segbase,
bin_directive,
srec_filename,