This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR ld/5522: Section contents partially overwritten with zero
- From: "H.J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Wed, 26 Dec 2007 17:25:29 -0800
- Subject: PATCH: PR ld/5522: Section contents partially overwritten with zero
ELF linker may write out a section even when its output section is
marked with SEC_NEVER_LOAD and override the next section. This patch
fixes it.
H.J.
---
2007-12-26 H.J. Lu <hongjiu.lu@intel.com>
PR ld/5522
* elflink.c (elf_link_input_bfd): Don't write out a section if
its output section is marked with SEC_NEVER_LOAD.
--- bfd/elflink.c.noload 2007-12-21 17:34:49.000000000 -0800
+++ bfd/elflink.c 2007-12-26 17:21:01.000000000 -0800
@@ -9599,6 +9599,7 @@ elf_link_input_bfd (struct elf_final_lin
default:
{
if (! (o->flags & SEC_EXCLUDE)
+ && ! (o->output_section->flags & SEC_NEVER_LOAD)
&& ! bfd_set_section_contents (output_bfd, o->output_section,
contents,
(file_ptr) o->output_offset,