aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68hc1x.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2004-03-20 23:16:43 +0000
committerH.J. Lu <hjl.tools@gmail.com>2004-03-20 23:16:43 +0000
commit59c2e50f2900f1256ee5b00551afd084a68a900b (patch)
tree7cd2a494803eed6d5a036bb37695fb3dee093066 /bfd/elf32-m68hc1x.c
parent023aaf9519725736042c2b233622ddfac1745596 (diff)
downloadgdb-59c2e50f2900f1256ee5b00551afd084a68a900b.zip
gdb-59c2e50f2900f1256ee5b00551afd084a68a900b.tar.gz
gdb-59c2e50f2900f1256ee5b00551afd084a68a900b.tar.bz2
bfd/
2004-03-20 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if unresolved symbols in objects aren't allowed. * elf-hppa.h (elf_hppa_relocate_section): Properly handle unresolved symbols. (elf_hppa_remark_useless_dynamic_symbols): Likewise. (elf_hppa_unmark_useless_dynamic_symbols): * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. * elf-m10200.c (mn10200_elf_relocate_section): Use RELOC_FOR_GLOBAL_SYMBOL. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf64-mmix.c (mmix_elf_relocate_section): Likewise. include/ 2004-03-20 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_link_info): Correct comments for the unresolved_syms_in_objects field. ld/ 2004-03-20 H.J. Lu <hongjiu.lu@intel.com> * lexsup.c (parse_args): Don't set unresolved_syms_in_objects or unresolved_syms_in_shared_libs for -Bdynamic and -Bstatic.
Diffstat (limited to 'bfd/elf32-m68hc1x.c')
-rw-r--r--bfd/elf32-m68hc1x.c53
1 files changed, 14 insertions, 39 deletions
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 709b8f4..24460ef 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -47,16 +47,6 @@ static void m68hc11_elf_set_symbol (bfd* abfd, struct bfd_link_info *info,
static bfd_boolean m68hc11_elf_export_one_stub
(struct bfd_hash_entry *gen_entry, void *in_arg);
-static bfd_boolean m68hc11_get_relocation_value
- (bfd* abfd,
- struct bfd_link_info* info,
- asection **local_sections,
- Elf_Internal_Sym* local_syms,
- Elf_Internal_Rela* rel,
- const char** name,
- bfd_vma* relocation,
- bfd_boolean* is_far);
-
static void scan_sections_for_abi (bfd*, asection*, PTR);
struct m68hc11_scan_param
@@ -919,7 +909,8 @@ elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
static bfd_boolean
-m68hc11_get_relocation_value (bfd *abfd, struct bfd_link_info *info,
+m68hc11_get_relocation_value (bfd *input_bfd, struct bfd_link_info *info,
+ asection *input_section,
asection **local_sections,
Elf_Internal_Sym *local_syms,
Elf_Internal_Rela *rel,
@@ -934,8 +925,8 @@ m68hc11_get_relocation_value (bfd *abfd, struct bfd_link_info *info,
Elf_Internal_Sym *sym;
const char* stub_name = 0;
- symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (abfd);
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
r_symndx = ELF32_R_SYM (rel->r_info);
@@ -953,33 +944,17 @@ m68hc11_get_relocation_value (bfd *abfd, struct bfd_link_info *info,
*is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
if (*is_far)
stub_name = (bfd_elf_string_from_elf_section
- (abfd, symtab_hdr->sh_link,
+ (input_bfd, symtab_hdr->sh_link,
sym->st_name));
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- *relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- *relocation = 0;
- else
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, abfd,
- sec, rel->r_offset, TRUE)))
- return FALSE;
- *relocation = 0;
- }
+ bfd_boolean unresolved_reloc, warned;
+
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr,
+ *relocation, sec, unresolved_reloc,
+ info, warned);
+
*is_far = (h && (h->other & STO_M68HC12_FAR));
stub_name = h->root.root.string;
}
@@ -989,7 +964,7 @@ m68hc11_get_relocation_value (bfd *abfd, struct bfd_link_info *info,
else
{
*name = (bfd_elf_string_from_elf_section
- (abfd, symtab_hdr->sh_link, sym->st_name));
+ (input_bfd, symtab_hdr->sh_link, sym->st_name));
if (*name == NULL || **name == '\0')
*name = bfd_section_name (input_bfd, sec);
}
@@ -1082,8 +1057,8 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
(*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel);
howto = arel.howto;
- m68hc11_get_relocation_value (input_bfd, info,
- local_sections, local_syms,
+ m68hc11_get_relocation_value (input_bfd, info, input_section,
+ local_sections, local_syms,
rel, &name, &relocation, &is_far);
/* Do the memory bank mapping. */