This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]