X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-nds32.c;h=6b0b813af0bf3521e1c6bfdba61e4af7dc3c630a;hb=4ac31493c8029a4594dd6dbdcee058aead5ce781;hp=3168587560a945eba927573adbf74de89c44f750;hpb=b3adc24a0713411ab38a21dc894dd40dbc5c8f4f;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c index 3168587560..6b0b813af0 100644 --- a/bfd/elf32-nds32.c +++ b/bfd/elf32-nds32.c @@ -3684,7 +3684,7 @@ nds32_elf_link_hash_table_create (bfd *abfd) { struct elf_nds32_link_hash_table *ret; - bfd_size_type amt = sizeof (struct elf_nds32_link_hash_table); + size_t amt = sizeof (struct elf_nds32_link_hash_table); ret = (struct elf_nds32_link_hash_table *) bfd_zmalloc (amt); if (ret == NULL) @@ -4281,7 +4281,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) eh->dyn_relocs = NULL; -keep:; + keep:; } /* Finally, allocate space. */ @@ -5827,7 +5827,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, case R_NDS32_SDA15S0_RELA: case R_NDS32_SDA15S0: align = 0x0; -handle_sda: + handle_sda: BFD_ASSERT (sec != NULL); /* If the symbol is in the abs section, the out_bfd will be null. @@ -6155,7 +6155,7 @@ handle_sda: break; } -check_reloc: + check_reloc: if (r != bfd_reloc_ok) { @@ -6204,7 +6204,7 @@ check_reloc: errmsg = _("internal error: unknown error"); /* Fall through. */ -common_error: + common_error: (*info->callbacks->warning) (info, errmsg, name, input_bfd, input_section, offset); break; @@ -6488,7 +6488,7 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) goto get_vma; case DT_JMPREL: s = ehtab->srelplt->output_section; -get_vma: + get_vma: BFD_ASSERT (s != NULL); dyn.d_un.d_ptr = s->vma; bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); @@ -6817,6 +6817,10 @@ nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) flagword out_fpu_config; flagword in_fpu_config; + /* FIXME: What should be checked when linking shared libraries? */ + if ((ibfd->flags & DYNAMIC) != 0) + return TRUE; + /* TODO: Revise to use object-attributes instead. */ if (!nds32_check_vec_size (ibfd)) return FALSE; @@ -7442,7 +7446,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, p = *head; if (p == NULL || p->sec != sec) { - bfd_size_type amt = sizeof (*p); + size_t amt = sizeof (*p); p = (struct elf_dyn_relocs *) bfd_alloc (dynobj, amt); if (p == NULL) return FALSE; @@ -8281,7 +8285,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, goto done; } -done: + done: /* Bit-15 of insn16 should be set for a valid instruction. */ if ((insn16 & 0x8000) == 0) return 0; @@ -8603,7 +8607,7 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) goto done; } -done: + done: if (insn & 0x80000000) return 0; @@ -9448,7 +9452,7 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, if (p < endp) *p |= 0x80; } -done_adjust_diff: + done_adjust_diff: if (sec == sect) { @@ -12567,7 +12571,7 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, clean_nds32_elf_blank (); } -finish: + finish: if (internal_relocs != NULL && elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); @@ -12581,7 +12585,7 @@ finish: return result; -error_return: + error_return: result = FALSE; goto finish; } @@ -12593,6 +12597,18 @@ static struct bfd_elf_special_section const nds32_elf_special_sections[] = {NULL, 0, 0, 0, 0} }; +static bfd_boolean +nds32_elf_section_flags (const Elf_Internal_Shdr *hdr) +{ + const char *name = hdr->bfd_section->name; + + if (strncmp (name, ".sbss", 5) == 0 + || strncmp (name, ".sdata", 6) == 0) + hdr->bfd_section->flags |= SEC_SMALL_DATA; + + return TRUE; +} + static bfd_boolean nds32_elf_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info, @@ -13152,7 +13168,7 @@ nds32_fag_remove_unused_fpbase (bfd *abfd, asection *sec, goto error_return; } -finish: + finish: if (relax_blank_list) { nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list); @@ -13160,7 +13176,7 @@ finish: } return result; -error_return: + error_return: result = FALSE; goto finish; } @@ -13291,7 +13307,7 @@ nds32_elf_get_relocated_section_contents (bfd *abfd, free (reloc_vector); return data; -error_return: + error_return: free (reloc_vector); return NULL; } @@ -14018,7 +14034,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, asection *insec, bfd_byte *incontents, #endif } -finish: + finish: if (incontents) contents = NULL; @@ -14047,7 +14063,7 @@ finish: return result; -error_return: + error_return: result = FALSE; goto finish; } @@ -14093,6 +14109,7 @@ error_return: #define elf_backend_object_p nds32_elf_object_p #define elf_backend_final_write_processing nds32_elf_final_write_processing #define elf_backend_special_sections nds32_elf_special_sections +#define elf_backend_section_flags nds32_elf_section_flags #define bfd_elf32_bfd_get_relocated_section_contents \ nds32_elf_get_relocated_section_contents #define bfd_elf32_bfd_is_target_special_symbol nds32_elf_is_target_special_symbol