This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFA:] elflink.c: Hide _GLOBAL_OFFSET_TABLE_
> * elf-bfd.h (struct elf_link_local_dynamic_entry): New 'input_section'
> field. (bfd_elf_link_create_local_dynamic_entry): Declare.
> * elflink.c (bfd_elf_link_create_local_dynamic_entry): New function
> extracted from...
> (bfd_elf_link_record_local_dynamic_symbol): ...here. Invoke it to
> create the local dynamic symbol and set input_section to NULL.
> (bfd_elf_final_link): For a local dynamic symbol, piggyback on
> input_section if the ELF section is undefined.
> * elf32-sparc.c (elf32_sparc_link_hash_table_create): Use bfd_zmalloc to
> zero the structure.
> (create_got_section): Use BFD_ASSERT instead of abort. Create a local
> dynamic symbol for _GLOBAL_OFFSET_TABLE_.
> (elf32_sparc_relocate_section): In a shared object, use the index of the
> local dynamic symbol for relocations against _GLOBAL_OFFSET_TABLE_.
> * elf64-sparc.c (struct sparc64_elf_link_hash_table): New 'sgot' and
> 'srelgot' fields.
> (create_got_section): New function.
> (sparc64_elf_create_dynamic_sections): Likewise.
> (sparc64_elf_check_relocs): Invoke create_got_section instead of
> _bfd_elf_create_got_section. Use the sgot and srelgot shortcuts.
> (sparc64_elf_size_dynamic_sections): Use the srelgot shortcut.
> (sparc64_elf_relocate_section): In a shared object, use the index of the
> local dynamic symbol for relocations against _GLOBAL_OFFSET_TABLE_.
> Use the sgot and srelgot shortcuts.
> (sparc64_elf_finish_dynamic_symbol): Use the sgot and srelgot shortcuts.
> (sparc64_elf_finish_dynamic_sections): Use the sgot shortcut.
> (elf_backend_create_dynamic_sections): Define to
> sparc64_elf_create_dynamic_sections.
FWIW this one has completed a full testing cycle against GCC 4.0.0pre on
sparc64-sun-solaris2.9 and sparc-sun-solaris2.8.
--
Eric Botcazou