Fix the gas test align2 for the PDP11 by ensuring that the .text and .data sections are written to their aligned sizes.

* pdp11.c (set_section_contents): Pad the .text and .data sections
	to their aligned sizes.
This commit is contained in:
Nick Clifton 2015-02-24 10:13:51 +00:00
parent ec86f43468
commit 3ad797fd08
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2015-02-24 Nick Clifton <nickc@redhat.com>
* pdp11.c (set_section_contents): Pad the .text and .data sections
to their aligned sizes.
2015-02-23 Yoshinori Sato <ysato@users.sourceforge.jp>
* config.bfd: Add h8300-*-linux.

View File

@ -1172,6 +1172,14 @@ 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;
/* If necessary, pad the section to its aligned size. */
if ((section == obj_datasec (abfd)
|| section == obj_textsec (abfd))
&& count < section->size
&& (bfd_seek (abfd, section->filepos + offset + section->size - 1, SEEK_SET) != 0
|| bfd_bwrite ("", 1, abfd) != 1))
return FALSE;
}
return TRUE;