Don't write zeros to a gap in the output file
authorAlan Modra <amodra@gmail.com>
Thu, 2 Mar 2023 09:29:14 +0000 (19:59 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 2 Mar 2023 10:47:49 +0000 (21:17 +1030)
commit281309f3c8c692d0246f4437ad3c635fe69dbaf7
treea71129f16d377792c38795b8ecc416e9c362ae11
parent0d5adb56c85da38a0f95e872fda05cc6446010c3
Don't write zeros to a gap in the output file

Writing out zeros is counterproductive if a file system supports
sparse files.  A very large gap need not take much actual disk space,
but it usually will if zeros are written.

memory_bseek also supports not writing out zeros in a gap.

* elf.c (write_zeros): Delete.
(assign_file_positions_for_load_sections): Don't call write_zeros.
Comment.
bfd/elf.c