This is the mail archive of the binutils-cvs@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]

[binutils-gdb] MIPS/BFD: Call `mips_elf32_rtype_to_howto' directly with o32


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8205a328f8b852086652841dfc2aff4ca0b16d45

commit 8205a328f8b852086652841dfc2aff4ca0b16d45
Author: Maciej W. Rozycki <macro@mips.com>
Date:   Wed Mar 28 21:37:37 2018 +0100

    MIPS/BFD: Call `mips_elf32_rtype_to_howto' directly with o32
    
    Call `mips_elf32_rtype_to_howto' directly rather than via the
    `->elf_backend_mips_rtype_to_howto' method in the o32 backend,
    complementing commit 861fb55ab50a ("Defer allocation of R_MIPS_REL32 GOT
    slots"), <https://sourceware.org/ml/binutils/2008-08/msg00096.html>, and
    reverting the change to `mips_info_to_howto_rel' originally made with
    commit 0a44bf6950b3 ("mips-vxworks support"),
    <https://sourceware.org/ml/binutils/2006-03/msg00179.html>.
    
    With `mips_vxworks_rtype_to_howto' gone there is a single backend method
    used across all o32 targets, so there in no need for the indirection and
    the associated extra cost.  This also makes the o32 backend consistent
    with the n32 and n64 backends.
    
    	bfd/
    	* elf32-mips.c (mips_info_to_howto_rel): Call
    	`mips_elf32_rtype_to_howto' directly rather than via
    	`->elf_backend_mips_rtype_to_howto'.

Diff:
---
 bfd/ChangeLog    | 6 ++++++
 bfd/elf32-mips.c | 4 +---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b88eb6c..2f82091 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2018-02-28  Maciej W. Rozycki  <macro@mips.com>
+
+	* elf32-mips.c (mips_info_to_howto_rel): Call
+	`mips_elf32_rtype_to_howto' directly rather than via
+	`->elf_backend_mips_rtype_to_howto'.
+
 2018-03-28  Renlin Li  <renlin.li@arm.com>
 
 	PR ld/22970
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index d6005ff..3767677 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -2235,12 +2235,10 @@ mips_elf32_rtype_to_howto (bfd *abfd,
 static bfd_boolean
 mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
-  const struct elf_backend_data *bed;
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  bed = get_elf_backend_data (abfd);
-  cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (abfd, r_type, FALSE);
+  cache_ptr->howto = mips_elf32_rtype_to_howto (abfd, r_type, FALSE);
   if (cache_ptr->howto == NULL)
     {
       /* xgettext:c-format */


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