[PATCH][GOLD] Handle target specific relocatable relocation.

Ian Lance Taylor iant@google.com
Wed May 26 00:42:00 GMT 2010


"Doug Kwan (關振德)" <dougkwan@google.com> writes:

> 2010-05-25  Doug Kwan  <dougkwan@google.com>
>
>         * arm.cc (Arm_scan_relocatable_relocs): New class.
>         (Target_arm::relocate_special_relocatable): New method.
>         (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
>         (Arm_relocate_functions::thumb_branch_common): Same.
>         (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
>         instead of Default_scan_relocatable_relocs.
>         * i386.cc (Target_i386::relocate_special_relocatable): New method.
>         * powerpc.cc (Target_powerpc::relocate_special_relocatable): Same.
>         * sparc.cc (Target_sparc::relocate_speical_relocatable): Same.
>         * target-reloc.h (relocate_for_relocatable): Let target handle
>         relocation strategy Relocatable_relocs::RELOC_SPECIAL.
>         * target.h (Sized_target::relocate_special_relocatable): New method.
>         * x86_64.cc (Target_x86_64::relocate_special_relocatable): Same.
>         * testsuite/testfile.cc (Target_test::relocate_special_relocatable):
>         Same.



> +  // Perform target-specific processing in a relocatable link.  This is
> +  // only used if we use the relocation strategy RELOC_SPECIAL.
>  
> +  virtual void
> +  relocate_special_relocatable(const Relocate_info<size, big_endian>* relinfo,
> +			       unsigned int sh_type,
> +			       const unsigned char* preloc_in,
> +			       size_t relnum,
> +			       Output_section* output_section,
> +			       off_t offset_in_output_section,
> +			       unsigned char* view,
> +			       typename elfcpp::Elf_types<size>::Elf_Addr
> +				 view_address,
> +			       section_size_type view_size,
> +			       unsigned char* preloc_out) = 0;

It's OK to make this simply { gold_unreachable(); } rather than making
it pure virtual.  That will make it the same as make_symbol and
resolve.  Then you don't have to change the other targets.

This is OK with that change.

Thanks.

Ian



More information about the Binutils mailing list