X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-sh64.c;h=4e88de936d6611119a516d44322a000db8a929f9;hb=bb7c96deb1a14ef7e8b51d5339a65a8064515c78;hp=3de856265be896d4a17d3fe2160195fbab1ec827;hpb=cd123cb70c845b890eed231a84e6e84c92c2ef92;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 3de856265b..4e88de936d 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -1,6 +1,5 @@ /* SuperH SH64-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -60,7 +59,7 @@ static int sh64_elf_get_symbol_type static bfd_boolean sh64_elf_add_symbol_hook (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *); -static bfd_boolean sh64_elf_link_output_symbol_hook +static int sh64_elf_link_output_symbol_hook (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *, struct elf_link_hash_entry *); static bfd_boolean sh64_backend_section_from_shdr @@ -104,7 +103,8 @@ static void sh64_find_section_for_address /* This COFF-only function (only compiled with COFF support, making ELF-only chains problematic) returns TRUE early for SH4, so let's just define it TRUE here. */ -#define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) TRUE +#define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) \ + ((void) f, (void) h, (void) i, TRUE) #define GOT_BIAS (-((long)-32768)) #define INCLUDE_SHMEDIA @@ -198,7 +198,8 @@ sh64_elf_copy_private_data (bfd * ibfd, bfd * obfd) == elf_elfheader (ibfd)->e_flags)); elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; - return TRUE; + + return _bfd_elf_copy_private_bfd_data (ibfd, obfd); } static bfd_boolean @@ -396,7 +397,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, right, and tweak the name when it's output. Otherwise, we make an indirect symbol of it. */ flagword flags - = info->relocatable || info->emitrelocations + = bfd_link_relocatable (info) || info->emitrelocations ? BSF_GLOBAL : BSF_GLOBAL | BSF_INDIRECT; char *dl_name @@ -440,9 +441,9 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, free (dl_name); if (h->type != STT_DATALABEL - || ((info->relocatable || info->emitrelocations) + || ((bfd_link_relocatable (info) || info->emitrelocations) && h->root.type != bfd_link_hash_undefined) - || (! info->relocatable && !info->emitrelocations + || (! bfd_link_relocatable (info) && !info->emitrelocations && h->root.type != bfd_link_hash_indirect)) { /* Make sure we don't get confused on invalid input. */ @@ -477,7 +478,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, we don't need to look up and make sure to emit the main symbol for each DataLabel symbol. */ -bfd_boolean +static int sh64_elf_link_output_symbol_hook (struct bfd_link_info *info, const char *cname, Elf_Internal_Sym *sym, @@ -486,13 +487,13 @@ sh64_elf_link_output_symbol_hook (struct bfd_link_info *info, { char *name = (char *) cname; - if (info->relocatable || info->emitrelocations) + if (bfd_link_relocatable (info) || info->emitrelocations) { if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL) name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0; } - return TRUE; + return 1; } /* Check a SH64-specific reloc and put the value to relocate to into @@ -529,11 +530,9 @@ shmedia_prepare_reloc (struct bfd_link_info *info, bfd *abfd, && ((*relocation + rel->r_addend) & 1) == 0) msg = _("PTA mismatch: a SHcompact address (bit 0 == 0)"); - if (msg != NULL - && ! ((*info->callbacks->reloc_dangerous) - (info, msg, abfd, input_section, - rel->r_offset))) - return FALSE; + if (msg != NULL) + (*info->callbacks->reloc_dangerous) + (info, msg, abfd, input_section, rel->r_offset); } else { @@ -765,11 +764,11 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] = }; #undef TARGET_BIG_SYM -#define TARGET_BIG_SYM bfd_elf32_sh64_vec +#define TARGET_BIG_SYM sh64_elf32_vec #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf32-sh64" #undef TARGET_LITTLE_SYM -#define TARGET_LITTLE_SYM bfd_elf32_sh64l_vec +#define TARGET_LITTLE_SYM sh64_elf32_le_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-sh64l" @@ -777,11 +776,11 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] = /* NetBSD support. */ #undef TARGET_BIG_SYM -#define TARGET_BIG_SYM bfd_elf32_sh64nbsd_vec +#define TARGET_BIG_SYM sh64_elf32_nbsd_vec #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf32-sh64-nbsd" #undef TARGET_LITTLE_SYM -#define TARGET_LITTLE_SYM bfd_elf32_sh64lnbsd_vec +#define TARGET_LITTLE_SYM sh64_elf32_nbsd_le_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-sh64l-nbsd" #undef ELF_MAXPAGESIZE @@ -796,11 +795,11 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] = /* Linux support. */ #undef TARGET_BIG_SYM -#define TARGET_BIG_SYM bfd_elf32_sh64blin_vec +#define TARGET_BIG_SYM sh64_elf32_linux_be_vec #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf32-sh64big-linux" #undef TARGET_LITTLE_SYM -#define TARGET_LITTLE_SYM bfd_elf32_sh64lin_vec +#define TARGET_LITTLE_SYM sh64_elf32_linux_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-sh64-linux" #undef elf32_bed