From: H.J. Lu Date: Wed, 3 Jun 2020 16:09:40 +0000 (-0700) Subject: arc: Don't generate dynamic relocation for non SEC_ALLOC sections X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50d036364fb2a71b3ac9a0b0cdbe58296832a1b2;p=binutils-gdb.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 436eb5a2c77..a10deb893d0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -8,6 +8,11 @@ * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define. * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define. +2020-06-03 H.J. Lu + + * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic + relocations for non SEC_ALLOC sections. + 2020-06-03 H.J. Lu * elf-bfd.h (_bfd_elf_maybe_set_textrel): New diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 774d3e793db..06ee60ac409 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