Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / elfnn-riscv.c
index 8fcb1067fd6b5332adc53c02928db7f5b6c154f4..a9e8132505ba969027ac6aed9d336251fc9a2755 100644 (file)
@@ -98,6 +98,14 @@ struct _bfd_riscv_elf_obj_tdata
    && elf_tdata (bfd) != NULL                          \
    && elf_object_id (bfd) == RISCV_ELF_DATA)
 
+static bfd_boolean
+elfNN_riscv_mkobject (bfd *abfd)
+{
+  return bfd_elf_allocate_object (abfd,
+                                 sizeof (struct _bfd_riscv_elf_obj_tdata),
+                                 RISCV_ELF_DATA);
+}
+
 #include "elf/common.h"
 #include "elf/internal.h"
 
@@ -4161,15 +4169,16 @@ _bfd_riscv_relax_section (bfd *abfd, asection *sec,
              symval = 0;
              sym_sec = bfd_und_section_ptr;
            }
-         else if (h->root.u.def.section->output_section == NULL
-                  || (h->root.type != bfd_link_hash_defined
-                      && h->root.type != bfd_link_hash_defweak))
-           continue;
-         else
+         else if ((h->root.type == bfd_link_hash_defined
+                   || h->root.type == bfd_link_hash_defweak)
+                  && h->root.u.def.section != NULL
+                  && h->root.u.def.section->output_section != NULL)
            {
              symval = h->root.u.def.value;
              sym_sec = h->root.u.def.section;
            }
+         else
+           continue;
 
          if (h->type != STT_FUNC)
            reserve_size =
@@ -4362,6 +4371,7 @@ riscv_elf_obj_attrs_arg_type (int tag)
 #define elf_info_to_howto_rel               NULL
 #define elf_info_to_howto                   riscv_info_to_howto_rela
 #define bfd_elfNN_bfd_relax_section         _bfd_riscv_relax_section
+#define bfd_elfNN_mkobject                  elfNN_riscv_mkobject
 
 #define elf_backend_init_index_section      _bfd_elf_init_1_index_section
 
This page took 0.026617 seconds and 4 git commands to generate.