This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Move some STT_GNU_IFUNC support to generic ELF linker


On Tue, Jun 16, 2009 at 8:51 AM, H.J. Lu<hjl.tools@gmail.com> wrote:
> On Tue, Jun 16, 2009 at 4:56 AM, Nick Clifton<nickc@redhat.com> wrote:
>> Hi H.J.
>>
>>> Here is the first patch. ?OK for trunk?
>>
>>> 2009-06-15 ?H.J. Lu ?<hongjiu.lu@intel.com>
>>>
>>> ? ? ? ?* configure.in (elf): Add elf-ifunc.lo.
>>>
>>> ? ? ? ?* configure: Regenerated.
>>> ? ? ? ?* Makefile.in: Likewise.
>>>
>>> ? ? ? ?* elf-bfd.h (elf_link_hash_table): Add sgot, sgotplt,
>>> ? ? ? ?srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc.
>>>
>>> ? ? ? ?* elf32-i386.c (elf_i386_link_hash_table): Remove sgot,
>>> ? ? ? ?sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
>>> ? ? ? ?irelifunc.
>>> ? ? ? ?(elf_i386_link_hash_table_create): Likewise.
>>> ? ? ? ?(elf_i386_create_dynamic_sections): Likewise.
>>> ? ? ? ?(elf_i386_check_relocs): Likewise.
>>> ? ? ? ?(elf_i386_allocate_dynrelocs): Likewise.
>>> ? ? ? ?(elf_i386_size_dynamic_sections): Likewise.
>>> ? ? ? ?(elf_i386_relocate_section): Likewise.
>>> ? ? ? ?(elf_i386_finish_dynamic_symbol): Likewise.
>>> ? ? ? ?(elf_i386_finish_dynamic_sections): Likewise.
>>> ? ? ? ?(elf_i386_create_got_section): Removed.
>>>
>>> ? ? ? ?* elf64-x86-64.c (elf64_x86_64_link_hash_table): Remove sgot,
>>> ? ? ? ?sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
>>> ? ? ? ?irelifunc.
>>> ? ? ? ?(elf64_x86_64_compute_jump_table_size): Updated.
>>> ? ? ? ?(elf64_x86_64_link_hash_table_create): Likewise.
>>> ? ? ? ?(elf64_x86_64_create_dynamic_sections): Likewise.
>>> ? ? ? ?(elf64_x86_64_check_relocs): Likewise.
>>> ? ? ? ?(elf64_x86_64_allocate_dynrelocs): Likewise.
>>> ? ? ? ?(elf64_x86_64_size_dynamic_sections): Likewise.
>>> ? ? ? ?(elf64_x86_64_relocate_section): Likewise.
>>> ? ? ? ?(elf64_x86_64_finish_dynamic_symbol): Likewise.
>>> ? ? ? ?(elf64_x86_64_finish_dynamic_sections): Likewise.
>>> ? ? ? ?(elf64_x86_64_create_got_section): Removed.
>>>
>>> ? ? ? ?* elflink.c (_bfd_elf_create_got_section): Use log_file_align
>>> ? ? ? ?for pointer alignment. ?Set up section pointers.
>>> ? ? ? ?(_bfd_elf_create_dynamic_sections): Likewise.
>>> ? ? ? ?(_bfd_elf_create_ifunc_sections): Moved to ...
>>> ? ? ? ?* elf-ifunc.c: Here. ?New.
>>>
>>> ? ? ? ?* Makefile.am (BFD32_BACKENDS): Add elf-ifunc.lo.
>>> ? ? ? ?(BFD32_BACKENDS_CFILES): Add elf-ifunc.c.
>>> ? ? ? ?Run "make dep-am".
>>
>> Approved - please apply.
>>
>> Cheers
>> ?Nick
>>
>
> IA64 needs this patch to fix linker failures. I will check it in as an
> obvious fix. Please let me know if other backends need similar
> patches.
>
> Thanks.
>
>
> H.J.
> ---
> 2009-06-16 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?* elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
> ? ? ? ?rel_got_sec and plt_sec.
> ? ? ? ?(elfNN_ia64_relax_section): Updated.
> ? ? ? ?(elfNN_ia64_create_dynamic_sections): Likewise.
> ? ? ? ?(get_got): Likewise.
> ? ? ? ?(allocate_dynrel_entries): Likewise.
> ? ? ? ?(elfNN_ia64_size_dynamic_sections): Likewise.
> ? ? ? ?(set_got_entry): Likewise.
> ? ? ? ?(elfNN_ia64_choose_gp): Likewise.
> ? ? ? ?(elfNN_ia64_relocate_section): Likewise.
> ? ? ? ?(elfNN_ia64_finish_dynamic_symbol): Likewise.
> ? ? ? ?(elfNN_ia64_finish_dynamic_sections): Likewise.
>

I think ARM needs the patch below, which is pretty much
mechanical.  I tested it with a cross linker.  Here is the
complete list of files which may need update.

M      elf32-lm32.c
M      elf32-ppc.c
M      elf32-hppa.c
M      elf64-ppc.c
M      elf32-frv.c
M      elfxx-sparc.h
M      elf64-hppa.c
M      elf32-sh.c
M      elf32-s390.c
M      elfxx-mips.c
M      elf32-m32r.c
M      elf32-xtensa.c
M      elf64-s390.c
M      elf32-arm.c
M      elf32-bfin.c

I don't have access to those hardwares. I can only test
with a cross linker.  Please let me know if I should go
ahead to make those changes.

Thanks.


-- 
H.J.
----
2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-arm.c (elf32_arm_link_hash_table): Remove sgot,
	sgotplt, srelgot, splt and srelplt.
	(create_got_section): Likewise.
	(elf32_arm_create_dynamic_sections): Likewise.
	(elf32_arm_link_hash_table_create): Likewise.
	(arm_type_of_stub): Likewise.
	(elf32_arm_size_stubs): Likewise.
	(bfd_elf32_arm_process_before_allocation): Likewise.
	(elf32_arm_final_link_relocate): Likewise.
	(elf32_arm_check_relocs): Likewise.
	(allocate_dynrelocs): Likewise.
	(elf32_arm_size_dynamic_sections): Likewise.
	(elf32_arm_output_arch_local_syms): Likewise.

Attachment: bfd-sec-arm-1.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]