aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-frv.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-06-03 09:12:40 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-06-03 09:12:53 -0700
commit9a6896021df5997a1ea5d52b86b833920005e652 (patch)
tree61c0985a6aadf176dce027fdbc43258148d42bc3 /bfd/elf32-frv.c
parent50d036364fb2a71b3ac9a0b0cdbe58296832a1b2 (diff)
downloadgdb-9a6896021df5997a1ea5d52b86b833920005e652.zip
gdb-9a6896021df5997a1ea5d52b86b833920005e652.tar.gz
gdb-9a6896021df5997a1ea5d52b86b833920005e652.tar.bz2
frv: Don't generate dynamic relocation for non SEC_ALLOC sections
Don't generate dynamic relocations for non SEC_ALLOC sections because run-time loader won't process them. * elf32-frv.c (elf32_frv_relocate_section): Don't generate dynamic relocations for non SEC_ALLOC sections.
Diffstat (limited to 'bfd/elf32-frv.c')
-rw-r--r--bfd/elf32-frv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 51ea8fa..83de5e6 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -2712,7 +2712,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
const char *name;
int r_type;
asection *osec;
- struct frvfdpic_relocs_info *picrel;
+ struct frvfdpic_relocs_info *picrel = NULL;
bfd_vma orig_addend = rel->r_addend;
r_type = ELF32_R_TYPE (rel->r_info);
@@ -2806,6 +2806,9 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
case R_FRV_GETTLSOFF_RELAX:
case R_FRV_TLSOFF_RELAX:
case R_FRV_TLSMOFF:
+ if ((input_section->flags & SEC_ALLOC) == 0)
+ break;
+
if (h != NULL)
picrel = frvfdpic_relocs_info_for_global (frvfdpic_relocs_info
(info), input_bfd, h,