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] VAX/BFD: Don't crash on discarded GOT


Hi,

 This change fixes a linker crash where GOT is produced but not copied to 
output, e.g. because of the .got.plt input section being discarded through 
the /DISCARD/ linker script keyword -- not a particularly useful use case, 
but the linker shouldn't crash regardless.

 OK to apply?

2013-05-20  Maciej W. Rozycki  <macro@linux-mips.org>

	bfd/
	* elf32-vax.c (elf_vax_finish_dynamic_sections): Don't set GOT's
	entry size if there is no ELF section data.

  Maciej

binutils-2.23.52-20130506-vax-finish-dynamic.patch
Index: binutils/bfd/elf32-vax.c
===================================================================
--- binutils.orig/bfd/elf32-vax.c
+++ binutils/bfd/elf32-vax.c
@@ -1989,7 +1989,8 @@ elf_vax_finish_dynamic_sections (bfd *ou
       bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8);
     }
 
-  elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+  if (elf_section_data (sgot->output_section) != NULL)
+    elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
 
   return TRUE;
 }


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