From 5c57f1be7b46ac95e44467c234e034e9e0389589 Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Thu, 4 Feb 2010 03:32:18 +0000 Subject: 2010-02-03 Doug Kwan * arm-reloc-property.cc (Arm_reloc_property_table::reloc_name_in_error_message): New method definition. * arm-reloc-property.h (Arm_reloc_property_table::get_implemented_static_reloc_property): New method definition. (Arm_reloc_property_table::reloc_name_in_error_message): New method declaration. * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change overflow to N. (GOT_PREL): Change implemented to Y. * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method. (Target_arm::Relocate::reloc_needs_sym_origin): Remove method. (Arm_relocate_functions::movw_abs_nc): Remove method. (Arm_relocate_functions::movt_abs): Ditto. (Arm_relocate_functions::thm_movw_abs_nc): Ditto. (Arm_relocate_functions::thm_movt_abs): Ditto. (Arm_relocate_functions::movw_rel_nc): Ditto. (Arm_relocate_functions::movw_rel): Ditto. (Arm_relocate_functions::movt_rel): Ditto. (Arm_relocate_functions:thm_movw_rel_nc): Ditto. (Arm_relocate_functions:thm_movw_rel): Ditto. (Arm_relocate_functions:thm_movt_rel): Ditto. (Arm_relocate_functions::movw, Arm_relocate_functions::movt, (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt): New method definitions. (Arm_relocation_functions::arm_grp_alu): Add assertion for group index. (Arm_relocation_functions::arm_grp_ldr): Ditto. (Arm_relocation_functions::arm_grp_ldrs): Ditto. (Arm_relocation_functions::arm_grp_ldc): Ditto. (Target_arm::Relocate::relocate): Check for non-static or unimplemented relocation code and exit early. Change calls to Target_arm::reloc_uses_thumb_bit and Target_arm::Reloc::reloc_needs_sym_origin to use relocation property instead. Refactor code to handle similar relocations to increase code sharing. Remove check for unsupported relocation code in switch statement. (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use relocation property table to find out size. Change error message to print out the name of a relocation code instead of the numeric value. (Target_arm::scan_reloc_for_stub): Use relocation property table instead of calling Target_arm::reloc_uses_thumb_bit(). --- gold/arm-reloc-property.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gold/arm-reloc-property.h') diff --git a/gold/arm-reloc-property.h b/gold/arm-reloc-property.h index 2d88211..349d862 100644 --- a/gold/arm-reloc-property.h +++ b/gold/arm-reloc-property.h @@ -293,6 +293,25 @@ class Arm_reloc_property_table return this->table_[code]; } + // Like get_reloc_property but only return non-NULL if relocation code is + // static and implemented. + const Arm_reloc_property* + get_implemented_static_reloc_property(unsigned int code) const + { + gold_assert(code < Property_table_size); + const Arm_reloc_property* arp = this->table_[code]; + return ((arp != NULL + && (arp->reloc_type() == Arm_reloc_property::RT_STATIC) + && arp->is_implemented()) + ? arp + : NULL); + } + + // Return a string describing the a relocation code that is not + // an implemented static reloc code. + std::string + reloc_name_in_error_message(unsigned int code); + private: // Copying is not allowed. Arm_reloc_property_table(const Arm_reloc_property_table&); -- cgit v1.1