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.
This commit is contained in:
Alan Modra
2022-08-03 22:08:01 +09:30
parent fcbfb25dcc
commit 94e27e8e69
2 changed files with 2 additions and 0 deletions

View File

@ -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 },

View File

@ -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 },