public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] frv: Don't generate dynamic relocation for non SEC_ALLOC sections
@ 2020-06-02 19:46 H.J. Lu
  2020-06-03 15:58 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2020-06-02 19:46 UTC (permalink / raw)
  To: binutils

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.
---
 bfd/elf32-frv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 51ea8fa27e..83de5e67b5 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,
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] frv: Don't generate dynamic relocation for non SEC_ALLOC sections
  2020-06-02 19:46 [PATCH] frv: Don't generate dynamic relocation for non SEC_ALLOC sections H.J. Lu
@ 2020-06-03 15:58 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2020-06-03 15:58 UTC (permalink / raw)
  To: H.J. Lu, binutils

Hi H.J.

>     	* elf32-frv.c (elf32_frv_relocate_section): Don't generate
> 	dynamic relocations for non SEC_ALLOC sections.

Approved - please apply.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-03 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 19:46 [PATCH] frv: Don't generate dynamic relocation for non SEC_ALLOC sections H.J. Lu
2020-06-03 15:58 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).