PowerPC: Don't generate unused section symbols
[binutils-gdb.git] / bfd / elf32-cris.c
index 6e5a2d87d6242ac53ca99ed3529d3656ead0e351..0228920e1fdb3416d76a4c9e93fb638c47b863dd 100644 (file)
@@ -1,5 +1,5 @@
 /* CRIS-specific support for 32-bit ELF.
-   Copyright (C) 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 2000-2021 Free Software Foundation, Inc.
    Contributed by Axis Communications AB.
    Written by Hans-Peter Nilsson, based on elf32-fr30.c
    PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c.
@@ -3359,7 +3359,7 @@ cris_elf_check_relocs (bfd *abfd,
 
          /* No need to do anything if we're not creating a shared object.  */
          if (! bfd_link_pic (info)
-             || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
+             || (h != NULL && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)))
            break;
 
          /* We may need to create a reloc section in the dynobj and made room