aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-06-03 09:09:40 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-06-03 09:10:03 -0700
commit50d036364fb2a71b3ac9a0b0cdbe58296832a1b2 (patch)
tree008dbc8ed76a17d29def72740a3b5044f474e529
parent913e0fd47321873e1bfecedd73d5882b765fc8e6 (diff)
downloadfsf-binutils-gdb-50d036364fb2a71b3ac9a0b0cdbe58296832a1b2.zip
fsf-binutils-gdb-50d036364fb2a71b3ac9a0b0cdbe58296832a1b2.tar.gz
fsf-binutils-gdb-50d036364fb2a71b3ac9a0b0cdbe58296832a1b2.tar.bz2
arc: 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-arc.c (elf_arc_relocate_section): Don't generate dynamic relocations for non SEC_ALLOC sections.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arc.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 436eb5a..a10deb8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -10,6 +10,11 @@
2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
+ * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
+ relocations for non SEC_ALLOC sections.
+
+2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
+
* elf-bfd.h (_bfd_elf_maybe_set_textrel): New
* elf32-arm.c (maybe_set_textrel): Removed.
(elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 774d3e7..06ee60a 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1782,6 +1782,7 @@ elf_arc_relocate_section (bfd * output_bfd,
case R_ARC_PC32:
case R_ARC_32_PCREL:
if (bfd_link_pic (info)
+ && (input_section->flags & SEC_ALLOC) != 0
&& (!IS_ARC_PCREL_TYPE (r_type)
|| (h != NULL
&& h->dynindx != -1