| OLD | NEW |
| 1 /* SuperH SH64-specific support for 64-bit ELF | 1 /* SuperH SH64-specific support for 64-bit ELF |
| 2 Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, | 2 Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, |
| 3 2010, 2011, 2012 Free Software Foundation, Inc. | 3 2010, 2011, 2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of BFD, the Binary File Descriptor library. | 5 This file is part of BFD, the Binary File Descriptor library. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| (...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 | 2417 |
| 2418 r_symndx = ELF64_R_SYM (rel->r_info); | 2418 r_symndx = ELF64_R_SYM (rel->r_info); |
| 2419 if (r_symndx < symtab_hdr->sh_info) | 2419 if (r_symndx < symtab_hdr->sh_info) |
| 2420 h = NULL; | 2420 h = NULL; |
| 2421 else | 2421 else |
| 2422 { | 2422 { |
| 2423 h = sym_hashes[r_symndx - symtab_hdr->sh_info]; | 2423 h = sym_hashes[r_symndx - symtab_hdr->sh_info]; |
| 2424 while (h->root.type == bfd_link_hash_indirect | 2424 while (h->root.type == bfd_link_hash_indirect |
| 2425 || h->root.type == bfd_link_hash_warning) | 2425 || h->root.type == bfd_link_hash_warning) |
| 2426 h = (struct elf_link_hash_entry *) h->root.u.i.link; | 2426 h = (struct elf_link_hash_entry *) h->root.u.i.link; |
| 2427 |
| 2428 /* PR15323, ref flags aren't set for references in the same |
| 2429 object. */ |
| 2430 h->root.non_ir_ref = 1; |
| 2427 } | 2431 } |
| 2428 | 2432 |
| 2429 /* Some relocs require a global offset table. */ | 2433 /* Some relocs require a global offset table. */ |
| 2430 if (dynobj == NULL) | 2434 if (dynobj == NULL) |
| 2431 { | 2435 { |
| 2432 switch (ELF64_R_TYPE (rel->r_info)) | 2436 switch (ELF64_R_TYPE (rel->r_info)) |
| 2433 { | 2437 { |
| 2434 case R_SH_GOTPLT_LOW16: | 2438 case R_SH_GOTPLT_LOW16: |
| 2435 case R_SH_GOTPLT_MEDLOW16: | 2439 case R_SH_GOTPLT_MEDLOW16: |
| 2436 case R_SH_GOTPLT_MEDHI16: | 2440 case R_SH_GOTPLT_MEDHI16: |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3062 return (struct bfd_hash_entry *) ret; | 3066 return (struct bfd_hash_entry *) ret; |
| 3063 } | 3067 } |
| 3064 | 3068 |
| 3065 /* Create an sh64 ELF linker hash table. */ | 3069 /* Create an sh64 ELF linker hash table. */ |
| 3066 | 3070 |
| 3067 static struct bfd_link_hash_table * | 3071 static struct bfd_link_hash_table * |
| 3068 sh64_elf64_link_hash_table_create (bfd *abfd) | 3072 sh64_elf64_link_hash_table_create (bfd *abfd) |
| 3069 { | 3073 { |
| 3070 struct elf_link_hash_table *ret; | 3074 struct elf_link_hash_table *ret; |
| 3071 | 3075 |
| 3072 ret = (struct elf_link_hash_table *) bfd_malloc (sizeof (* ret)); | 3076 ret = (struct elf_link_hash_table *) bfd_zmalloc (sizeof (* ret)); |
| 3073 if (ret == (struct elf_link_hash_table *) NULL) | 3077 if (ret == (struct elf_link_hash_table *) NULL) |
| 3074 return NULL; | 3078 return NULL; |
| 3075 | 3079 |
| 3076 if (!_bfd_elf_link_hash_table_init (ret, abfd, | 3080 if (!_bfd_elf_link_hash_table_init (ret, abfd, |
| 3077 sh64_elf64_link_hash_newfunc, | 3081 sh64_elf64_link_hash_newfunc, |
| 3078 sizeof (struct elf_sh64_link_hash_entry), | 3082 sizeof (struct elf_sh64_link_hash_entry), |
| 3079 GENERIC_ELF_DATA)) | 3083 GENERIC_ELF_DATA)) |
| 3080 { | 3084 { |
| 3081 free (ret); | 3085 free (ret); |
| 3082 return NULL; | 3086 return NULL; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3759 s = bfd_get_linker_section (dynobj, ".rela.bss"); | 3763 s = bfd_get_linker_section (dynobj, ".rela.bss"); |
| 3760 BFD_ASSERT (s != NULL); | 3764 BFD_ASSERT (s != NULL); |
| 3761 | 3765 |
| 3762 rel.r_offset = (h->root.u.def.value | 3766 rel.r_offset = (h->root.u.def.value |
| 3763 + h->root.u.def.section->output_section->vma | 3767 + h->root.u.def.section->output_section->vma |
| 3764 + h->root.u.def.section->output_offset); | 3768 + h->root.u.def.section->output_offset); |
| 3765 rel.r_info = ELF64_R_INFO (h->dynindx, R_SH_COPY64); | 3769 rel.r_info = ELF64_R_INFO (h->dynindx, R_SH_COPY64); |
| 3766 rel.r_addend = 0; | 3770 rel.r_addend = 0; |
| 3767 loc = s->contents; | 3771 loc = s->contents; |
| 3768 loc += s->reloc_count++ * sizeof (Elf64_External_Rela); | 3772 loc += s->reloc_count++ * sizeof (Elf64_External_Rela); |
error: old chunk mismatch |
None
| OLD | NEW |