forked from Imagelibrary/binutils-gdb
PR24144, pdp11-ld overwriting section data with zeros
bfd/ PR 24144 * pdp11.c (set_section_contents): Revert 2015-02-24 change. gas/ PR 24144 * config/obj-aout.c (obj_aout_frob_file_before_fix): Write to end of section to ensure file contents cover aligned section size.
This commit is contained in:
@@ -1146,14 +1146,6 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user