- /* Finally remove all input sections which have not made it into
- the hash table at all. */
- for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
- if (secinfo->first_str == NULL)
- secinfo->sec->flags |= SEC_EXCLUDE | SEC_KEEP;
+ /* If the input sections were padded according to their alignments,
+ then pad the output too. */
+ if (align)
+ secinfo->sec->size = (secinfo->sec->size + align - 1) & -align;
+
+ /* Finally remove all input sections which have not made it into
+ the hash table at all. */
+ for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
+ if (secinfo->first_str == NULL)
+ secinfo->sec->flags |= SEC_EXCLUDE | SEC_KEEP;