aout target fails
Nicholas Clifton
nickc@redhat.com
Mon Feb 23 15:56:00 GMT 2015
Hi Alan,
> Nick, your git commit 37e3922e is responsible for
> pdp11-dec-aout +FAIL: align1
> and a bunch of other pdp11 testsuite failures.
I cannot reproduce this failure. :-(
I could see a problem with the align2 test however. Please could you
try out the patch below and let me know if it fixes the problems you are
seeing ? Also can you give me the full list of regressions so that I
can check the other cases too ?
Cheers
Nick
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index 0c2bb13..aefc5ee 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -1143,7 +1143,7 @@ NAME (aout, set_section_contents) (bfd *abfd,
bfd_size_type count)
{
file_ptr text_end;
- bfd_size_type text_size;
+ bfd_size_type text_size = 0;
if (! abfd->output_has_begun)
{
@@ -1172,6 +1172,23 @@ NAME (aout, set_section_contents) (bfd *abfd,
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
|| bfd_bwrite (location, count, abfd) != count)
return FALSE;
+
+ /* Write zero-padding at the end of the text section. */
+ if (section == obj_textsec (abfd) && count < text_size)
+ {
+ static char zero_buf [16];
+
+ text_size -= count;
+ while (text_size > 16)
+ {
+ if (bfd_bwrite (zero_buf, 16, abfd) != 16)
+ return FALSE;
+ text_size -= 16;
+ }
+ if (text_size > 0
+ && bfd_bwrite (zero_buf, text_size, abfd) != text_size)
+ return FALSE;
+ }
}
return TRUE;
More information about the Binutils
mailing list