binutils/binutils-2.20.51.0.10-sec-merge-emit.patch

21 lines
629 B
Diff

--- a/bfd/merge.c 2010-08-20 12:19:33.000000000 +0100
+++ b/bfd/merge.c 2010-08-20 12:18:01.000000000 +0100
@@ -307,6 +307,9 @@
len = -off & (entry->alignment - 1);
if (len != 0)
{
+ /* We should never have an entry with an alignment
+ greater than the section's alignment. */
+ BFD_ASSERT (len <= (bfd_size_type) (1 << alignment_power));
if (bfd_bwrite (pad, len, abfd) != len)
goto err;
off += len;
@@ -324,6 +327,7 @@
/* Trailing alignment needed? */
off = sec->size - off;
if (off != 0
+ && alignment_power
&& bfd_bwrite (pad, off, abfd) != off)
goto err;