[committed] MIPS/BFD: Keep EI_ABIVERSION setting together

Maciej W. Rozycki macro@mips.com
Thu Jun 21 20:44:00 GMT 2018


Shuffle code in `_bfd_mips_post_process_headers' so that the setting of 
the EI_ABIVERSION ELF file header field is complete before calling 
`_bfd_elf_post_process_headers'.  This used to be the case, but was 
changed with commit 351cdf24d223 ("[MIPS] Implement O32 FPXX, FP64 and 
FP64A ABI extensions") for no reason.

	bfd/
	* elfxx-mips.c (_bfd_mips_post_process_headers): Keep 
	EI_ABIVERSION setting together.
---
 bfd/elfxx-mips.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

binutils-mips-bfd-post-process-headers-abiversion-order.diff
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c	2018-06-21 19:34:59.000000000 +0100
+++ binutils/bfd/elfxx-mips.c	2018-06-21 19:35:33.447571723 +0100
@@ -16258,11 +16258,11 @@ _bfd_mips_post_process_headers (bfd *abf
 	i_ehdrp->e_ident[EI_ABIVERSION] = MIPS_LIBC_ABI_MIPS_PLT;
     }
 
-  _bfd_elf_post_process_headers (abfd, link_info);
-
   if (mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64
       || mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64A)
     i_ehdrp->e_ident[EI_ABIVERSION] = MIPS_LIBC_ABI_MIPS_O32_FP64;
+
+  _bfd_elf_post_process_headers (abfd, link_info);
 }
 
 int



More information about the Binutils mailing list