[PATCH] arc: Don't generate dynamic relocation for non SEC_ALLOC sections

H.J. Lu hjl.tools@gmail.com
Tue Jun 2 19:46:11 GMT 2020


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.
---
 bfd/elf32-arc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 774d3e793d..06ee60ac40 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
-- 
2.26.2



More information about the Binutils mailing list