[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binutils
Subject:    [PATCH] TILEPro/BFD: Don't crash on discarded GOT
From:       "Maciej W. Rozycki" <macro () linux-mips ! org>
Date:       2013-07-27 22:50:59
Message-ID: alpine.LFD.2.03.1307272341530.3015 () linux-mips ! org
[Download RAW message or body]

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-07-27  Maciej W. Rozycki  <macro@linux-mips.org>

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

  Maciej

binutils-2.23.52-20130506-tilepro-finish-dynamic.patch
Index: binutils/bfd/elf32-tilepro.c
===================================================================
--- binutils.orig/bfd/elf32-tilepro.c
+++ binutils/bfd/elf32-tilepro.c
@@ -3909,8 +3909,9 @@ tilepro_elf_finish_dynamic_sections (bfd
 		  PLT_ENTRY_SIZE - PLT_HEADER_SIZE);
 	}
 
-      elf_section_data (splt->output_section)->this_hdr.sh_entsize
-	= PLT_ENTRY_SIZE;
+      if (elf_section_data (splt->output_section) != NULL)
+	elf_section_data (splt->output_section)->this_hdr.sh_entsize
+	  = PLT_ENTRY_SIZE;
     }
 
   if (htab->elf.sgotplt)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic