X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-lm32.c;h=82c4fa0eef7ec5e4d192d3aa3f20af7c7e6b8de9;hb=efba5c2319d6c25393e5cce9a2d30bbc0cb53123;hp=242876489fa277d8ea013af3386c4328cd1a5abb;hpb=a0f6fd217fa53ab80a335fb69f12f1f28ac3335a;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 242876489f..82c4fa0eef 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -1,5 +1,5 @@ /* Lattice Mico32-specific support for 32-bit ELF - Copyright (C) 2008-2019 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. Contributed by Jon Beniston This file is part of BFD, the Binary File Descriptor library. @@ -132,7 +132,7 @@ static struct bfd_link_hash_table * lm32_elf_link_hash_table_create (bfd *abfd) { struct elf_lm32_link_hash_table *ret; - bfd_size_type amt = sizeof (struct elf_lm32_link_hash_table); + size_t amt = sizeof (struct elf_lm32_link_hash_table); ret = bfd_zmalloc (amt); if (ret == NULL) @@ -195,8 +195,7 @@ create_rofixup_section (bfd *dynobj, struct bfd_link_info *info) | SEC_LINKER_CREATED | SEC_READONLY)); if (lm32fdpic_fixup32_section (info) == NULL - || ! bfd_set_section_alignment (dynobj, - lm32fdpic_fixup32_section (info), 2)) + || !bfd_set_section_alignment (lm32fdpic_fixup32_section (info), 2)) return FALSE; return TRUE; @@ -555,8 +554,8 @@ lm32_elf_object_p (bfd *abfd) /* Set machine type flags just before file is written out. */ -static void -lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) +static bfd_boolean +lm32_elf_final_write_processing (bfd *abfd) { elf_elfheader (abfd)->e_machine = EM_LATTICEMICO32; elf_elfheader (abfd)->e_flags &=~ EF_LM32_MACH; @@ -568,6 +567,7 @@ lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) default: abort (); } + return _bfd_elf_final_write_processing (abfd); } /* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a @@ -820,7 +820,7 @@ lm32_elf_relocate_section (bfd *output_bfd, relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); - name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + name = name == NULL ? bfd_section_name (sec) : name; } else { @@ -1035,7 +1035,7 @@ lm32_elf_relocate_section (bfd *output_bfd, if ((!h) || (h && h->root.type != bfd_link_hash_undefweak)) { /* Only create .rofixup entries for relocs in loadable sections. */ - if ((bfd_get_section_flags (output_bfd, input_section->output_section) + if ((bfd_section_flags (input_section->output_section) & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) { @@ -1089,7 +1089,7 @@ lm32_elf_relocate_section (bfd *output_bfd, name = (bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name)); if (name == NULL || *name == '\0') - name = bfd_section_name (input_bfd, sec); + name = bfd_section_name (sec); } switch (r) @@ -2119,7 +2119,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd, /* Strip this section if we don't need it; see the comment below. */ } - else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) + else if (CONST_STRNEQ (bfd_section_name (s), ".rela")) { if (s->size != 0 && s != htab->root.srelplt) relocs = TRUE; @@ -2254,7 +2254,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd, /* Don't generate entries for weak symbols. */ if (!h || (h && h->root.type != bfd_link_hash_undefweak)) { - if (!discarded_section (s) && !((bfd_get_section_flags (ibfd, s) & SEC_ALLOC) == 0)) + if (!discarded_section (s) && !((bfd_section_flags (s) & SEC_ALLOC) == 0)) { switch (ELF32_R_TYPE (internal_relocs->r_info)) { @@ -2276,7 +2276,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd, if (!strcmp (current->name, h->root.root.string)) break; } - if (!current && !discarded_section (s) && (bfd_get_section_flags (ibfd, s) & SEC_ALLOC)) + if (!current && !discarded_section (s) && (bfd_section_flags (s) & SEC_ALLOC)) { /* Will this have an entry in the GOT. */ if (ELF32_R_TYPE (internal_relocs->r_info) == R_LM32_16_GOT) @@ -2376,7 +2376,7 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags); htab->root.splt = s; if (s == NULL - || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment)) + || !bfd_set_section_alignment (s, bed->plt_alignment)) return FALSE; if (bed->want_plt_sym) @@ -2407,7 +2407,7 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) flags | SEC_READONLY); htab->root.srelplt = s; if (s == NULL - || ! bfd_set_section_alignment (abfd, s, ptralign)) + || !bfd_set_section_alignment (s, ptralign)) return FALSE; if (htab->root.sgot == NULL @@ -2446,7 +2446,7 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) flags | SEC_READONLY); htab->srelbss = s; if (s == NULL - || ! bfd_set_section_alignment (abfd, s, ptralign)) + || !bfd_set_section_alignment (s, ptralign)) return FALSE; } }