[binutils-gdb] MIPS/BFD: Fix rightshift for remaining n32 reloc howtos

Maciej W. Rozycki macro@sourceware.org
Mon Oct 6 20:40:01 GMT 2025


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

commit d9b826d8fc194be33331971d64ca8be2abae2a15
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Mon Oct 6 21:37:28 2025 +0100

    MIPS/BFD: Fix rightshift for remaining n32 reloc howtos
    
    Correct the rightshift amount for the R_MIPS_HIGHER, R_MIPS_HIGHEST and
    R_MIPS_CALL_HI16 RELA relocation howtos, missed with commit f38e9921479a
    ("MIPS HI16 and LO16 reloc howtos").

Diff:
---
 bfd/elfn32-mips.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 07e222cd4bf..7c9967268c0 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -1264,7 +1264,7 @@ static reloc_howto_type elf_mips_howto_table_rela[] =
 
   /* Get the higher value of a 64 bit addend.  */
   HOWTO (R_MIPS_HIGHER,		/* type */
-	 0,			/* rightshift */
+	 32,			/* rightshift */
 	 4,			/* size */
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
@@ -1279,7 +1279,7 @@ static reloc_howto_type elf_mips_howto_table_rela[] =
 
   /* Get the highest value of a 64 bit addend.  */
   HOWTO (R_MIPS_HIGHEST,	/* type */
-	 0,			/* rightshift */
+	 48,			/* rightshift */
 	 4,			/* size */
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
@@ -1294,7 +1294,7 @@ static reloc_howto_type elf_mips_howto_table_rela[] =
 
   /* High 16 bits of displacement in global offset table.  */
   HOWTO (R_MIPS_CALL_HI16,	/* type */
-	 0,			/* rightshift */
+	 16,			/* rightshift */
 	 4,			/* size */
 	 16,			/* bitsize */
 	 false,			/* pc_relative */


More information about the Binutils-cvs mailing list