aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorLulu Cai <cailulu@loongson.cn>2024-08-09 17:40:59 +0800
committerliuzhensong <liuzhensong@loongson.cn>2024-08-26 17:25:45 +0800
commit05b3e96495386ee41358c68b8787274ce77ae049 (patch)
tree4ae4d35b7fb12ea1083533cd6f017e1fd894d4dc /bfd
parent387f97a1b24e968e06dd62f91a26eb0a883fff58 (diff)
downloadgdb-05b3e96495386ee41358c68b8787274ce77ae049.zip
gdb-05b3e96495386ee41358c68b8787274ce77ae049.tar.gz
gdb-05b3e96495386ee41358c68b8787274ce77ae049.tar.bz2
LoongArch: Fix wrong relocation handling of symbols defined by PROVIDE
If the symbol defined by PROVIDE in the link script is not in SECTION, the symbol is placed in the ABS section. The linker considers that symbols in the ABS section do not need to calculate PC relative offsets. Symbols in ABS sections should calculate PC relative offsets normally based on relocations.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elfnn-loongarch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index f58ced3..6de101b 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -3313,7 +3313,7 @@ loongarch_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
/* The r_symndx will be STN_UNDEF (zero) only for relocs against symbols
from removed linkonce sections, or sections discarded by a linker
script. Also for R_*_SOP_PUSH_ABSOLUTE and PCREL to specify const. */
- if (r_symndx == STN_UNDEF || bfd_is_abs_section (sec))
+ if (r_symndx == STN_UNDEF)
{
defined_local = false;
resolved_local = false;