2005-04-04 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (bfd_elf_set_group_contents): Ignore linker created
group section.
(assign_section_numbers): Accept link_info. Check SHT_GROUP
sections for relocatable files only. Remove the linker created
group sections.
(_bfd_elf_compute_section_file_positions): Pass link_info to
assign_section_numbers.
* elfxx-ia64.c (elfNN_ia64_object_p): New.
(elf_backend_object_p): Defined.
gas/
2005-04-04 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-ia64.c (start_unwind_section): Undo the change
of 2004-08-18.
(generate_unwind_image, dot_endp): Likewise.
* elf-bfd.h (elf_backend_data): Add int to
elf_backend_section_from_shdr.
(bfd_elf_section_data): Update comment for this_idx.
(_bfd_elf_make_section_from_shdr): Add int.
* elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
* elf.c (_bfd_elf_make_section_from_shdr): Take section index
and use it to set this_idx in bfd_elf_section_data.
(bfd_section_from_shdr): Pass shindex to
_bfd_elf_make_section_from_shdr.
(_bfd_elf_section_from_bfd_section): Use this_idx in
bfd_elf_section_data to find section index.
* elf32-arm.c (elf32_arm_section_from_shdr): Take section
index and pass it to _bfd_elf_make_section_from_shdr.
* elf32-i370.c(i370_elf_section_from_shdr): Likewise.
* elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
* elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
* elf32-v850.c (v850_elf_section_from_shdr): Likewise.
* elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
* elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
* elf64-x86-64.c (elf64_x86_64_section_from_shdr): Likewise.
* elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
2005-02-15 Jan Beulich <jbeulich@novell.com>
* elfxx-ia64.c (ia64_howto_table): Correct strings for
R_IA64_DTPMOD64[LM]SB.
gas/
2005-02-15 Jan Beulich <jbeulich@novell.com>
* config/tc-ia64.c (ia64_gen_real_reloc_type): Define and initialize
new variables type, suffix, and width. Handle
BFD_RELOC_IA64_DIR(32|64)[LM]SB in FUNC_LT_FPTR_RELATIVE case.
Handle BFD_RELOC_IA64_DIR64[LM]SB in FUNC_TP_RELATIVE case. Add
FUNC_DTP_MODULE case. Handle BFD_RELOC_IA64_DIR32[LM]SB in
FUNC_DTP_RELATIVE case. Return incoming relocation type if
BFD_RELOC_IA64_IPLT[LM]SB in FUNC_IPLT_RELOC case. Generate warning
if unable to translate relocation type, using the new variables.
gas/testsuite/
2005-02-15 Jan Beulich <jbeulich@novell.com>
* gas/ia64/reloc.[ds]: New.
* gas/ia64/reloc-bad.[ls]: New.
* gas/ia64/ia64.exp: Run new tests.
* elfxx-ia64.c (elfNN_ia64_relax_section): Allow relax
backward branch in the same section.
(elfNN_ia64_relocate_section): Inform users that the input
section is too big to relax br instruction when overflow
happens to R_IA64_PCREL21B, R_IA64_PCREL21BI, R_IA64_PCREL21M
and R_IA64_PCREL21F.
Nick Clifton <nickc@redhat.com>
PR 290
* bfd.c (_bfd_default_error_handler): Make it global.
* elf-bfd.h (elf_backend_data): Add link_order_error_handler.
* elf.c (assign_section_numbers): Cope gracefully with sections
which have SHF_LINK_ORDER set but no sh_link set up.
* elflink.c (elf_get_linked_section_vma): Likewise.
* elfxx-ia64.c (elf_backend_link_order_error_handler): New. Set
it to NULL.
* elfxx-target.h (elf_backend_link_order_error_handler): New.
Set it to _bfd_default_error_handler.
(elfNN_bed): Add elf_backend_link_order_error_handler.
* libbfd-in.h (_bfd_default_error_handler): New.
* libbfd.h: Regenerated.
2004-07-26 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (bfd_elf_section_data): Add a pointer for the
linked-to section.
(elf_linked_to_section): New.
* elf.c (assign_section_numbers): Set up sh_link for
SHF_LINK_ORDER.
* elfxx-ia64.c (elfNN_ia64_final_write_processing): Set sh_info
to sh_link for SHT_IA_64_UNWIND sections.
gas/
2004-07-26 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-ia64.c (start_unwind_section): Set the linked-to
section.
(ia64_elf_section_change_hook): Set the linked-to section for
SHT_IA_64_UNWIND.
* elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
field to track if a relocation is against readonly section.
(count_dyn_reloc): Take a new argument for rent->reltext.
(elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
(get_reloc_section): Don't set ia64_info->reltext here.
(allocate_dynrel_entries): Set ia64_info->reltext here.
2003-12-04 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_relax_section): Use the
need_relax_finalize field in link_info instead of
relax_finalizing to check if the relax finalize pass is being
done.
include/
2003-12-04 H.J. Lu <hongjiu.lu@intel.com>
* bfdlink.h (bfd_link_info): Change relax_finalizing to
need_relax_finalize.
ld/
2003-12-04 H.J. Lu <hongjiu.lu@intel.com>
* emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Set
link_info.need_relax_finalize to TRUE.
* ldlang.c (lang_process): Use link_info.need_relax_finalize
instead of link_info.relax_finalizing.
* ldmain.c (main): Likewise.
bfd/ChangeLog
* elfxx-ia64.c (get_fptr): For fptr_rel, use dynobj not abfd.
(elfNN_ia64_size_dynamic_sections): When stripping sections, check
for ia64_info->rel_fptr_sec.
ld/ChangeLog
* emulparams/elf64_ia64.sh (OTHER_PLT_RELOC_SECTIONS): Include
.rela.opd if -pie.
(struct elfNN_ia64_local_hash_entry): Remove root. Add id and r_sym
fields.
(struct elfNN_ia64_local_hash_table): Remove.
(struct elfNN_ia64_link_hash_table): Change loc_hash_table's type
to htab_t. Add loc_hash_memory field.
(elfNN_ia64_local_hash_table_init, elfNN_ia64_new_loc_hash_entry):
Removed.
(elfNN_ia64_local_htab_hash, elfNN_ia64_local_htab_eq): New
functions.
(elfNN_ia64_hash_table_create): Use hashtab.h hashtable for
loc_hash_table. Initialize loc_hash_memory.
(elfNN_ia64_hash_table_free): New function.
(elfNN_ia64_local_hash_lookup): Remove.
(elfNN_ia64_local_dyn_sym_thunk): Change into htab_traverse
callback.
(elfNN_ia64_dyn_sym_traverse): Use htab_traverse.
(get_local_sym_hash): Use hashtab.h hashtable for loc_hash_table.
(bfd_elfNN_bfd_link_hash_table_free): Define.
* elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it.
(SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it.
* elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise.
* elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
* elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise.
* elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise.
Update all callers to provide the relocation being resolved.
* elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec.
(elfNN_ia64_dynamic_symbol_p): Change info->shared into
!info->executable.
(get_fptr): For -pie create .opd as writable section and create
.rela.opd as well.
(elfNN_ia64_check_relocs): Change info->shared into
!info->executable.
(allocate_fptr): Likewise.
(allocate_dynrel_entries): Account for a relative reloc for -pie
@fptr(). Don't account for a relative reloc if -pie want_ltoff_fptr
for undefweak symbol. Account for an IPLT reloc in .rela.opd
section if -pie.
(set_got_entry): Don't create a relative reloc if -pie
want_ltoff_fptr for undefweak symbol.
(set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie.
(elfNN_ia64_relocate_section): Emit a relative reloc for -pie
@fptr().
* elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol
even if -pie.
* elf32-i386.c (elf_i386_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
ld/
* emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Don't include
.opd if -pie.
(OTHER_READWRITE_SECTIONS): Include .opd if -pie.
* scripttempl/elf.sc: Use SHLIB_DATA_ADDR instead of DATA_ADDR
if -pie.
* elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
want_plt field.
(elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
for symbols with non-default visibility.
parameter symbol_table. Optionally use it instead of the symbol
table from the bfd. Save and restore output offsets and output
sections around bfd_get_relocated_section_contents. Fix a memory
leak.
(simple_save_output_info, simple_restore_output_info): New
functions.
* bfd-in2.h: Regenerate.
* dwarf2.c (read_abbrevs): Use
bfd_simple_get_relocated_section_contents instead of
bfd_get_section_contents.
(decode_line_info): Likewise.
(_bfd_dwarf2_find_nearest_line): Likewise. Don't call
find_rela_addend.
(find_rela_addend): Remove.
* elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
debugging sections.
(elfNN_ia64_hash_table_create): Create the hash table with malloc,
not bfd_zalloc.