X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felfnn-riscv.c;h=a9e8132505ba969027ac6aed9d336251fc9a2755;hb=07a78c595604b00908f06396aa221d446adbe6f8;hp=8fcb1067fd6b5332adc53c02928db7f5b6c154f4;hpb=dc1e8a474f904419abaa27da4be5b0f735a87255;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 8fcb1067fd..a9e8132505 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -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