From: H.J. Lu Date: Thu, 21 Apr 2016 00:10:55 +0000 (-0700) Subject: Don't check relocations in excluded sections X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ce03cea78d4d8bf00e29e4dfa4952d53f3b1064;p=binutils-gdb.git Don't check relocations in excluded sections When checking relocations after gc-sections has run, the unused sections have been removed. Don't check relocations in excluded sections. * elflink.c (_bfd_elf_link_check_relocs): Don't check relocations in excluded sections --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 73b0b4d1875..57bb506162f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-04-20 H.J. Lu + + * elflink.c (_bfd_elf_link_check_relocs): Don't check relocations + in excluded sections + 2016-04-20 H.J. Lu PR ld/19969 diff --git a/bfd/elflink.c b/bfd/elflink.c index 5af334ad172..b432384bd7d 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -3518,7 +3518,9 @@ _bfd_elf_link_check_relocs (bfd *abfd, struct bfd_link_info *info) Elf_Internal_Rela *internal_relocs; bfd_boolean ok; + /* Don't check relocations in excluded sections. */ if ((o->flags & SEC_RELOC) == 0 + || (o->flags & SEC_EXCLUDE) != 0 || o->reloc_count == 0 || ((info->strip == strip_all || info->strip == strip_debugger) && (o->flags & SEC_DEBUGGING) != 0)