X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bfd%2Felf32-nds32.c;h=27ffea2e69284b12c63725cdb6ac77dcb8ab5d4e;hb=cc364be6ff45669150077387f22723de33d5f1b1;hp=6215f2880093858b58c9c5e5a141f97e1b6705ad;hpb=fbaf61ad525eb2818598b699d44df32e46583925;p=external%2Fbinutils.git diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c index 6215f28..27ffea2 100644 --- a/bfd/elf32-nds32.c +++ b/bfd/elf32-nds32.c @@ -1,5 +1,5 @@ /* NDS32-specific support for 32-bit ELF. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2019 Free Software Foundation, Inc. Contributed by Andes Technology Corporation. This file is part of BFD, the Binary File Descriptor library. @@ -22,12 +22,10 @@ #include "sysdep.h" #include "bfd.h" -#include "bfd_stdint.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" #include "libiberty.h" -#include "bfd_stdint.h" #include "elf/nds32.h" #include "opcode/nds32.h" #include "elf32-nds32.h" @@ -3165,19 +3163,6 @@ static const struct nds32_reloc_map_entry nds32_reloc_map[] = /* Patch tag. */ -/* Reserve space for COUNT dynamic relocations in relocation selection - SRELOC. */ - -static inline void -elf32_nds32_allocate_dynrelocs (struct bfd_link_info *info, asection *sreloc, - bfd_size_type count) -{ - BFD_ASSERT (elf_hash_table (info)->dynamic_sections_created); - if (sreloc == NULL) - abort (); - sreloc->size += sizeof (Elf32_External_Rela) * count; -} - static reloc_howto_type * bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) @@ -5083,11 +5068,13 @@ ones32 (register unsigned int x) return (x & 0x0000003f); } +#if !HAVE_FLS static unsigned int fls (register unsigned int x) { return ffs (x & (-x)); } +#endif /* !HAVE_FLS */ #define nds32_elf_local_tlsdesc_gotent(bfd) \ (elf_nds32_tdata (bfd)->local_tlsdesc_gotent) @@ -5649,7 +5636,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, if (h->dynindx == -1) { _bfd_error_handler - (_("%pB: relocation %s against `%s' can not be used when" + (_("%pB: relocation %s against `%s' can not be used when " "making a shared object; recompile with -fPIC"), input_bfd, nds32_elf_howto_table[r_type].name, h->root.root.string); bfd_set_error (bfd_error_bad_value); @@ -6685,9 +6672,8 @@ nds32_elf_object_p (bfd *abfd) /* Store the machine number in the flags field. */ -static void -nds32_elf_final_write_processing (bfd *abfd, - bfd_boolean linker ATTRIBUTE_UNUSED) +static bfd_boolean +nds32_elf_final_write_processing (bfd *abfd) { unsigned long val; static unsigned int cur_mach = 0; @@ -6724,6 +6710,7 @@ nds32_elf_final_write_processing (bfd *abfd, elf_elfheader (abfd)->e_flags &= ~EF_NDS_ARCH; elf_elfheader (abfd)->e_flags |= val; + return _bfd_elf_final_write_processing (abfd); } /* Function to keep NDS32 specific file flags. */ @@ -13228,14 +13215,14 @@ nds32_elf_get_relocated_section_contents (bfd *abfd, symbol = *(*parent)->sym_ptr_ptr; if (symbol->section && discarded_section (symbol->section)) { - bfd_byte *p; + bfd_vma off; static reloc_howto_type none_howto = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, "unused", FALSE, 0, 0, FALSE); - p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); - _bfd_clear_contents ((*parent)->howto, input_bfd, input_section, - p); + off = (*parent)->address * bfd_octets_per_byte (input_bfd); + _bfd_clear_contents ((*parent)->howto, input_bfd, + input_section, data, off); (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; (*parent)->addend = 0; (*parent)->howto = &none_howto;