This is the mail archive of the
mailing list for the binutils project.
elf32-hppa shared lib support part 11
- To: binutils at sourceware dot cygnus dot com
- Subject: elf32-hppa shared lib support part 11
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Tue, 5 Sep 2000 16:07:44 +1100 (EST)
OK, here's the meat. I won't post the actual patch as it's quite large,
and there are so many changes that it's better reviewed by looking at the
whole file. (And a thank you to anyone who actually has the time to
For those who want diffs,
cvs diff -r1.13 -r1.14 bfd/elf32-hppa.c
cvs diff -r1.6 -r1.7 bfd/elf32-hppa.h
Shared library and PIC support.
* elf32-hppa.c (PLT_ENTRY_SIZE): New.
(enum elf32_hppa_stub_type): New.
(struct elf32_hppa_stub_hash_entry): Rename offset to
stub_offset. Add a number of new fields.
(struct elf32_hppa_link_hash_entry): New.
(struct elf32_hppa_link_hash_table): Add numerous fields. Remove
(elf32_hppa_hash_table): Rename to hppa_link_hash_table.
(elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup.
(elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc. Init
(hppa_link_hash_newfunc): New function.
(elf32_hppa_link_hash_table_create): Use above function. Init new
(elf32_hppa_stub_name): Rename to hppa_stub_name. Pass in reloc
instead of addend, and remove sym_name from args. Don't use
symbol name for local syms, instead use sym index.
(elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return
stub type rather than size. Pass in hash and handle import stub
case. Also pass in reloc instead of offset so we can calculate
PCREL22F and PCREL12F branches properly.
(elf32_hppa_build_one_stub): Rename to hppa_build_one_stub. Build
import and export stubs too.
(elf32_hppa_size_one_stub): Rename to hppa_size_one_stub. Handle
import and export stub sizing.
(elf32_hppa_check_relocs): New function.
(elf32_hppa_adjust_dynamic_symbol): New function.
(hppa_discard_copies): New function.
(elf32_hppa_size_dynamic_sections): New function.
(elf32_hppa_finish_dynamic_symbol): New function.
(elf32_hppa_size_stubs): Stash params in link hash table, and move
some local vars into the link hash table too. For shared links,
trundle over function syms, generating export stubs. Handle
PCREL22F branches. Break out stub creation code from here..
(hppa_add_stub): .. to here. New function.
(elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't
call the bfd linker. Use elf_gp to record global pointer.
Calculate a value from sections if $global$ is missing.
(bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link.
(elf32_hppa_gc_mark_hook): New function.
(elf32_hppa_gc_sweep_hook): New function.
(elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate.
Add rel to args, and remove howto, input_bfd, offset, addend,
sym_name as we can recalculate these locally. Handle calls to
dynamic objects, extra PIC relocs, PCREL22F branches. Change
handling of undefined weak syms. Check that stubs are in range.
Only look for import stubs on PCREL17F and PCREL22F relocs. Add
message on hitting a DPREL21L reloc that needs fixing. Subtract
off PC for PCREL14F. Break out code that does a stub lookup from
(hppa_get_stub_entry): ..to here. New function.
(elf32_hppa_relocate_insn): Merge into final_link_relocate.
(elf32_hppa_relocate_section): Handle got and plt relocs, dynamic
relocs, etc. etc.
(elf32_hppa_finish_dynamic_sections): New function.
(hppa_handle_PIC_calls): New function.
(elf32_hppa_build_stubs): Call it. Pass link_info to
(elf32_hppa_create_dynamic_sections): New function
to create .plt and .got then set .plt flags correctly.
(elf32_hppa_object_p): New function.
(elf32_hppa_elf_get_symbol_type): New function.
(elf_backend_plt_alignment): Set to 2.
(elf_backend_got_header_size): Reserve one entry.
* elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd.
(elf32_hppa_size_stubs): Pass in multi_subspace.
Linuxcare. Support for the Revolution.