public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] MIPS: Use R_MIPS_REL16 for BFD_RELOC_16
@ 2022-08-04  3:37 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-08-04  3:37 UTC (permalink / raw)
  To: bfd-cvs

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

commit 94e27e8e69a07d69554ee7598419646d3ee99907
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Aug 3 22:08:01 2022 +0930

    MIPS: Use R_MIPS_REL16 for BFD_RELOC_16
    
    R_MIPS_REL16 isn't a pc-relative reloc as the name might indicate.
    
            * elf64-mips.c (mips_reloc_map): Map BFD_RELOC_16 to R_MIPS_REL16.
            * elfn32-mips.c (mips_reloc_map): Likewise.

Diff:
---
 bfd/elf64-mips.c  | 1 +
 bfd/elfn32-mips.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 8097e7cd49d..c2c6604ef68 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -3684,6 +3684,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
 {
   { BFD_RELOC_NONE, R_MIPS_NONE },
   { BFD_RELOC_MIPS_16, R_MIPS_16 },
+  { BFD_RELOC_16, R_MIPS_REL16 },
   { BFD_RELOC_32, R_MIPS_32 },
   /* There is no BFD reloc for R_MIPS_REL32.  */
   { BFD_RELOC_64, R_MIPS_64 },
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 7cae394bfa0..af984545796 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -3514,6 +3514,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
 {
   { BFD_RELOC_NONE, R_MIPS_NONE },
   { BFD_RELOC_MIPS_16, R_MIPS_16 },
+  { BFD_RELOC_16, R_MIPS_REL16 },
   { BFD_RELOC_32, R_MIPS_32 },
   /* There is no BFD reloc for R_MIPS_REL32.  */
   { BFD_RELOC_CTOR, R_MIPS_32 },


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-04  3:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04  3:37 [binutils-gdb] MIPS: Use R_MIPS_REL16 for BFD_RELOC_16 Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).