LoongArch: Fix dynamic reloc not generated bug in some cases.

Message ID 20221203073435.1451856-1-mengqinggang@loongson.cn
State Accepted
Headers
Series LoongArch: Fix dynamic reloc not generated bug in some cases. |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

mengqinggang Dec. 3, 2022, 7:34 a.m. UTC
  bfd/ChangeLog:

	* elfnn-loongarch.c (loongarch_elf_relocate_section): Likewise.
---
 bfd/elfnn-loongarch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index c040c5b4ec8..8d8a6a47317 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -2890,7 +2890,7 @@  loongarch_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	      /* The offset must always be a multiple of the word size.
 		 So, we can use the least significant bit to record
 		 whether we have already processed this entry.  */
-	      if (local_got_offsets[r_symndx] == 0)
+	      if ((local_got_offsets[r_symndx] & 1) == 0)
 		{
 		  if (is_pic)
 		    {