[committed] MIPS/LD: Correct `mips-*-windiss' target emulation configuration

Message ID alpine.DEB.2.00.1801221924130.20647@tp.orcam.me.uk
State New
Headers show
Series
  • [committed] MIPS/LD: Correct `mips-*-windiss' target emulation configuration
Related show

Commit Message

Maciej W. Rozycki Jan. 26, 2018, 11:08 p.m.
Fix an issue with commit 73934d319dae ("Disable .gnu.hash on MIPS 
targets"), <https://sourceware.org/ml/binutils/2006-07/msg00341.html>, 
which in turn caused a regression with commit 861fb55ab50a ("Defer 
allocation of R_MIPS_REL32 GOT slots"), 
<https://sourceware.org/ml/binutils/2008-08/msg00096.html>, and use 
`mipself.em' as the extra emulation file for `mips-*-windiss' targets, 
removing a segmentation fault triggered as `_bfd_mips_elf_final_link' 
calls `htab_traverse' to process LA25 stubs with `htab->la25_stubs' 
being NULL.  This is in turn due to `_bfd_mips_elf_init_stubs' not 
having been called, which is only done by `mipself.em'.  No LA25 stubs 
are supposed to be produced for `mips-*-windiss' targets, however the 
internal data structures have to be initialized.

	ld/
	* emulparams/elf32mipswindiss.sh (EXTRA_EM_FILE): Set to 
	`mipself'.
---
Hi,

 This brings `mips-windiss' test results to:

mips-windiss  FAIL: nm --size-sort
mips-windiss  FAIL: ld-scripts/fill

being the only failures.

  Maciej
---
 ld/emulparams/elf32mipswindiss.sh |    1 +
 1 file changed, 1 insertion(+)

binutils-mips-ld-emul-windiss.diff

Patch

Index: binutils/ld/emulparams/elf32mipswindiss.sh
===================================================================
--- binutils.orig/ld/emulparams/elf32mipswindiss.sh	2017-12-12 00:50:04.000000000 +0000
+++ binutils/ld/emulparams/elf32mipswindiss.sh	2018-01-22 18:09:48.712979323 +0000
@@ -1,4 +1,5 @@ 
 TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=mipself
 SCRIPT_NAME=elf
 OUTPUT_FORMAT="elf32-bigmips"
 BIG_OUTPUT_FORMAT="elf32-bigmips"