This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: pic patch for arm-elf
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Philip Blundell <pb at nexus dot co dot uk>
- Cc: binutils at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Wed, 29 Oct 2003 10:24:18 +0000
- Subject: Re: pic patch for arm-elf
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> This patch implements GC for GOT and PLT relocs in the elf32-arm
> backend. One effect of this is to avoid a spurious R_ARM_NONE reloc
> which was blighting glibc by causing libc.so to be marked as
> DT_TEXTREL.
>
> It also replaces the code sequence used for PLT thunks with a more
> efficient version, which can make a significant difference on some
> processors.
>
> May I check this in?
>
> Thanks
>
> p.
>
>
> 2003-10-26 Philip Blundell <philb@gnu.org>
>
> * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
> code sequence.
> (PLT_HEADER_SIZE): New.
> (struct elf32_arm_pcrel_relocs_copied): Rename to ...
> (struct elf32_arm_relocs_copied): ... this. Count both
> pcrel and non-pcrel relocs. All uses updated.
> (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
> sections and symbol/section mapping cache.
> (create_got_section): New.
> (elf32_arm_create_dynamic_sections): New.
> (elf_backend_create_dynamic_sections): Use it.
> (elf32_arm_final_link_relocate): Support garbage collection of relocs.
> (elf32_arm_check_relocs): Likewise.
> (elf32_arm_adjust_dynamic_symbol): Likewise.
> (elf32_arm_copy_indirect_symbol): New.
> (elf32_arm_link_hash_table_create): Initialise new fields.
> (elf32_arm_gc_sweep_hook): Implement.
> (elf32_arm_discard_copies): Delete.
> (elf32_arm_finish_dynamic_symbol): Use new PLT code.
> (elf32_arm_finish_dynamic_sections): Likewise.
> (elf_backend_can_refcount): Define.
> (elf_backend_copy_indirect_symbol): Likewise.
> (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
OK.
I guess at some point we will want to GC the FOUR_WORD_PLT code, but I
guess that for now it's wise to keep it in case there are deviant dynamic
loaders around.
R.