2003-04-12 Alexandre Oliva <aoliva@redhat.com>
* elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
occurrences of the same test changed in the previous patch.
Optimize.
2003-04-11 Alexandre Oliva <aoliva@redhat.com>
* elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
(mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
GOT_DISP/addend only if the symbol got a global GOT entry.
2003-04-10 Alexandre Oliva <aoliva@redhat.com>
* elfxx-mips.c (mips_elf_calculate_relocation): Decay
GOT_PAGE/GOT_OFST referencing overridable symbol to
GOT_DISP/addend.
(_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
global symbol as GOT_DISP.
2003-04-10 Bob Wilson <bob.wilson@acm.org>
* elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
next relocation on an undefined symbol.
2003-04-09 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
Ignore relocations against r_symndx == 0.
2003-04-09 H.J. Lu <hjl@gnu.org>
* elf64-alpha.c (elf64_alpha_relocate_section): Don't return
FALSE for undefined symbols.
* elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
2003-04-09 Alexandre Oliva <aoliva@redhat.com>
* dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
and IRIX-specific shift-to-64-bit 4-byte lengths before following
addr_size.
2003-04-08 Alexandre Oliva <aoliva@redhat.com>
* elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
pointer size from ABI, not arch_bits_per_address.
2003-04-07 Kevin Buettner <kevinb@redhat.com>
* elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
constants for n32 ABI.
2003-04-06 Andrew Cagney <cagney@redhat.com>
* simple.c (bfd_simple_get_relocated_section_contents): Disable
free that leads to GDB vs BFD memory corruption.
2003-04-04 Stephane Carrez <stcarrez@nerim.fr>
* elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
symbols that mark the end of the section.
(m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
converting to a relative branch so that the offset is computed after
the relaxation; also relocate a jsr into a bsr if possible but don't
relax them if they are to a far symbol as we need to call the
trampoline code.
(elf_m68hc11_howto_table): Set pcrel_offset to true.
2003-04-04 Svein E. Seldal <Svein.Seldal@solidas.com>
* archures.c: Namespace cleanup. Rename bfd_mach_c3x to
bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x
* bfd-in2.h: Regenerate
* coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/
* cpu-tic4x.c: Ditto
2003-04-03 Nick Clifton <nickc@redhat.com>
* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
differently for object files and executables.
* peicode.h (coff_swap_scnhdr_in): Only set the s_size field
for object files or for executables who have not already
initialised the field.
* libpei.h (bfd_pe_executable_p): New macro. Return true if
the PE format bfd is an executable.
2003-04-03 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
here as it's too early to reliably determine locality.
(ppc_elf_gc_sweep_hook): Likewise.
(SYMBOL_REFERENCES_LOCAL): Expand comment.
2003-04-02 Bob Wilson <bob.wilson@acm.org>
* xtensa-modules.c: Remove comment indicating that this is a
generated file.
2003-04-02 Alan Modra <amodra@bigpond.net.au>
* elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
2003-04-01 Bob Wilson <bob.wilson@acm.org>
* Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
(ALL_MACHINES_CFILES): Add cpu-xtensa.c.
(BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
xtensa-modules.lo.
(BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
xtensa-modules.c.
(cpu-xtensa.lo): New target.
(elf32-xtensa.lo): Likewise.
(xtensa-isa.lo): Likewise.
(xtensa-modules.lo): Likewise.
* Makefile.in: Regenerate.
* archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
(bfd_archures_list): Add bfd_xtensa_arch.
* config.bfd: Handle xtensa-*-*.
* configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
* configure: Regenerate.
* reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
* targets.c (bfd_elf32_xtensa_be_vec): Declare.
(bfd_elf32_xtensa_le_vec): Likewise.
(bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
* cpu-xtensa.c: New file.
* elf32-xtensa.c: Likewise.
* xtensa-isa.c: Likewise.
* xtensa-modules.c: Likewise.
* libbfd.h: Regenerate.
* bfd-in2.h: Likewise.
2003-04-01 Nick Clifton <nickc@redhat.com>
* archures.c (bfd_mach_arm_unknown): Define.
* bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes,
bfd_arm_get_mach_from_notes): Prototype.
* bfd-in2.h: Regenerate.
* coff-arm.c (coff_arm_merge_private_bfd_data): Call
bfd_arm_merge_machines.
(coff_arm_final_link_postscript): Call bfd_arm_update_notes.
* coffcode.h (coff_set_arch_mach_hook): Call
bfd_arm_get_mach_from_notes.
* coffgen.c (coff_real_object_p): Revert previous delta.
* cpu_arm.c (arm_check_note): New function. Examine a note in a
.note section.
(bfd_arm_merge_machines): New function: Handle the merging of ARM
binaries compiled for different architectures..
(bfd_arm_update_notes): New function: Update an ARM note section.
(bfd_arm_get_mach_from_notes): New function: Extract a bfd machine
number from an ARM note section.
* elf32-arm.h (elf32_arm_object_p): Use
bfd_arm_get_mach_from_notes.
(elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
(elf32_arm_final_write_processing): Use bfd_arm_update_notes.
2003-04-01 Ben Elliston <bje@wasabisystems.com>
* dwarf2.c (read_attribute_value): Correct typo in comment.
2003-04-01 Nick Clifton <nickc@redhat.com>
* dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
instead of concat().
(decode_line_info): Only free filename if it is not NULL.
(add_line_info): Make a copy of the filename when storing it into
the info structure.
2003-03-31 Andreas Schwab <schwab@suse.de>
Daniel Jacobowitz <drow@mvista.com>
* simple.c (bfd_simple_get_relocated_section_contents): Add
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.
2003-03-31 David Heine <dlheine@suif.stanford.edu>
* aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of
bfd_alloc.
* dwarf2.c (concat_filename): Always allocate space for the
returned filename.
(decode_line_info): Free the allocated filename returned by
concat_filename.
* elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks.
* elf.c (copy_private_bfd_data): Likewise.
(_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer.
* elflink.h (elf_link_sort_relocs): Fix memory leak.
* format.c (bfd_check_format_matches): Likewise.
* linker.c (bfd_generic_final_link): Likewise.
* opncls.c (find_separate_debug_info): Likewise.
* simple.c (bfd_simple_get_relocated_section_contents): Likewise.
2003-03-28 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Correctly combine
visibilities.
2003-03-27 Jakub Jelinek <jakub@redhat.com>
* elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
to -1 before recomputing got offsets.
2003-03-26 Andreas Schwab <schwab@suse.de>
* elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
(elf_m68k_relocate_section): Use it to correctly handle symbols
forced to be local.
(elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
entries for symbols that are forced to be local.
2003-03-25 Alexandre Oliva <aoliva@redhat.com>
* elfxx-mips.c (_bfd_mips_relax_section): New function.
* elfxx-mips.h (_bfd_mips_relax_section): Declare.
* elfn32-mips.c, elf64-mips.c: Use it.
2003-03-25 Stan Cox <scox@redhat.com>
Nick Clifton <nickc@redhat.com>
Contribute support for Intel's iWMMXt chip - an ARM variant:
* archures.c: Add bfd_mach_arm_iWMMXt.
* reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt
object files to be linked with XScale ones.
(coff_arm_final_link_postscript): Update note section.
* coffcode.h (coff_set_arch_mach_hook): Handle note section.
* coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook
after identifying a coff binary.
* cpu-arm.c (processors): Add iWMMXt.
(arch_inf): Likewise.
* elf32-arm.h (arm_object_p): Handle note section.
(elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to
be linked with XScale ones.
(elf32_arm_section_flags): New function: Set flags on note section.
(elf32_arm_final_write_processing): Handle note section.
2003-03-21 DJ Delorie <dj@redhat.com>
* elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
_bfd_elf_rela_local_sym.
2003-03-20 H.J. Lu <hjl@gnu.org>
* elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
non-ELF outputs.
2003-03-20 Nick Clifton <nickc@redhat.com>
* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and
$idata5 in case bfd_coff_final_link is not called.
2003-03-19 Jakub Jelinek <jakub@redhat.com>
* elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
field.
(canon_reloc_count): Define.
(sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
reloc_count.
(sparc64_elf_canonicalize_reloc): New routine.
(bfd_elf64_canonicalize_reloc): Define.
2003-03-18 Jakub Jelinek <jakub@redhat.com>
* elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
againt mergeable sections. Take r_addend into account when caching
trampolines.
2003-03-18 Richard Henderson <rth@redhat.com>
* elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
local symbols that have no dyninfo.
2003-03-14 Gene Smith <gene.smith@siemens.com>
* ieee.c (ieee_write_expression): Handle the case where symbol is
NULL.
General formatting improvements.
2003-03-13 Nick Clifton <nickc@redhat.com>
* configure.in (LINGUAS): Add zh_CN.
* configure: Regenerate.
* po/zh_CN.po: New file.
2003-03-13 Elias Athanasopoulos <elathan@phys.uoa.gr>
* aout-cris.c (BYTES_IN_WORD): Don't define.
aout-encap.c: Likewise.
aout-ns32k.c: Likewise.
aout-tic30.c: Likewise.
hp300bsd.c: Likewise.
i386aout.c: Likewise.
i386dynix.c: Likewise.
i386linux.c: Likewise.
i386lynx.c: Likewise.
i386mach3.c: Likewise.
m68k4knetbsd.c: Likewise.
m68klinux.c: Likewise.
m68klynx.c: Likewise.
m68knetbsd.c: Likewise.
m88kmach3.c: Likewise.
mipsbsd.c: Likewise.
newsos3.c: Likewise.
sparclinux.c: Likewise.
sparclynx.c: Likewise.
sparcnetbsd.c: Likewise.
vaxbsd.c: Likewise. Fix comment formatting.
2003-03-12 Alexandre Oliva <aoliva@redhat.com>
* Reverted 2003-03-02's patch.
* elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
overridable.
* elf64-mips.c (mips_elf64_canonicalize_reloc,
mips_elf64_get_dynamic_reloc_upper_bound,
mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
(bfd_elf64_get_canonicalize_reloc,
bfd_elf64_get_dynamic_reloc_upper_bound,
bfd_elf64_canonicalize_dynamic_reloc): Define.
(mips_elf64_slurp_reloc_table): Support dynamic.
(mips_elf64_slurp_one_reloc_table): Adjust.
2003-03-12 Nick Clifton <nickc@redhat.com>
* xsym.c (bfd_sym_fetch_type_information_table_entry): Change
'index' to 'offset' in test for zero value.
2003-03-11 Alexandre Oliva <aoliva@redhat.com>
* elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
dynamic relocations pointing to local or section symbols, use the
NULL symbol instead. Document the choice to not emit an
additional R_MIPS_64 relocation.
2003-03-11 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
zero index dynamic tls relocs generated for the GOT. Tidy code.
Set "relocation" to 1 on DTPMOD32 relocs. Optimize HA adjustment.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2003-03-07 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
a tls_get_addr call.
* elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
(ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
ELF_LINK_NON_GOT_REF from weakdef.
* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
(ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
ELF_LINK_NON_GOT_REF from weakdef.
* elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one. Use throughout.
(elf_i386_adjust_dynamic_symbol): For weak symbols, copy
ELF_LINK_NON_GOT_REF from weakdef.
2003-03-06 Jakub Jelinek <jakub@redhat.com>
Andrew Haley <aph@redhat.com>
* elflink.h (elf_bfd_discard_info): Don't process eh frames if
output is relocateable.
2003-03-06 Steven Konopa <skonopa@kgo.csc.com>
* som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
R_COMMENT.
2003-03-06 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
error messages.
(ELIMINATE_COPY_RELOCS): Define to zero.
(ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
TLSLD relocs. Report reloc types on a number of errors. Optimize
LOCAL24PC check for non-local syms. Don't capitalize error messages.
* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
(ppc64_elf_relocate_section): Don't deref htab->tls_sec when
calculating TLSLD relocs. Report reloc types on a number of errors.
Don't capitalize error messages.
2003-03-03 H.J. Lu <hjl@gnu.org>
* elfxx-ia64.c (USE_BRL): Removed.
(oor_ip): Removed.
2003-03-03 J"orn Rennecke <joern.rennecke@superh.com>
* elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
relocation (no special function), and make it non-partial_inplace.
(sh_elf_relax_section): When creating a bsr, use a consistent value
no matter if the symbol is extern or not; set addend to -4.
Don't swap load / non-load instructions for SH4.
(sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
rather than if the symbol is external to determine if adjusting the
offset makes sense. Adjust the addend too if appropriate.
(sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
relocation.
2003-03-03 Nick Clifton <nickc@redhat.com>
* po/da.po: Installed latest translation.
2003-03-02 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (elf_mips_howto_table_rel): Change definition of
R_MIPS_PC16 to rightshift 2.
(elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
(bfd_elf32_bfd_reloc_type_lookup): Support
BFD_RELOC_MIPSEMB_16_PCREL_S2.
* elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
R_MIPS_PC16 to rightshift 2.
(mips_elf64_howto_table_rela): Likewise.
(mips_reloc_map): Map to rightshifted BFD reloc.
* elfn32-mips.c: The same as in elf64-mips.c.
* elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
(mips_elf_calculate_relocation): Handle rightshifted addends for
R_MIPS_PC16.
* reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
MIPS Embedded PIC. Remove superfluous empty COMMENT.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
2003-02-28 Richard Henderson <rth@redhat.com>
* elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
for ltoff22x relaxation.
2003-03-01 Alan Modra <amodra@bigpond.net.au>
* bfd-in.h (_bfd): Don't define.
* bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
* syms.c: Likewise.
* bfd-in2.h: Regenerate.
2003-02-27 Richard Henderson <rth@redhat.com>
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
(elfNN_ia64_check_relocs): Set it.
(allocate_global_data_got): Check it.
(allocate_local_got): Likewise.
(allocate_dynrel_entries): Likewise.
(elfNN_ia64_relax_ldxmov): New.
(elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
(elfNN_ia64_choose_gp): Split out from ...
(elfNN_ia64_final_link): ... here.
2003-02-27 Andrew Cagney <cagney@redhat.com>
* bfd.c (struct bfd): Rename "struct _bfd".
* bfd-in.h: Update copyright.
(struct bfd): Rename "struct _bfd".
(_bfd): Define for backward compatibility.
* bfd-in2.h: Regenerate.
2003-02-25 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
and rel_hdr2 when initially counting input relocs rather than after
creating output reloc sections.
(elf_link_read_relocs_from_section): Don't abort with wrong reloc
sizes.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
2003-02-24 Kris Warkentin <kewarken@qnx.com>
* elf.c (elfcore_read_notes): Add check for QNX style core file.
(elfcore_grog_nto_note): New function.
(elfcore_grog_nto_gregs): New function.
(elfcore_grog_nto_status): New function.
2003-02-24 Alan Modra <amodra@bigpond.net.au>
* elflink.c (_bfd_elf_create_got_section): Check existing .got
section flags before concluding that we've already been called.
Don't use register keyword.
(_bfd_elf_create_dynamic_sections): Don't use register keyword.
(_bfd_elf_create_linker_section): Formatting.
2003-02-20 jmc <jmc@prioris.mini.pw.edu.pl>
* coff-h8300.c: Fix typo: intial -> initial.
* coff-ppc.c: Likewise.
2003-02-20 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c: Formatting.
(allocate_dynrelocs): LD and GD relocs against the same sym need
separate GOT entries.
(ppc_elf_relocate_section): Correct GOT handling for multiple GOT
entries per symbol.
2003-02-19 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
removal. Localize vars. Remove unnecessary dynobj test.
* elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
of INFO.
(allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
and optimize.
(elf_i386_relocate_section): Likewise.
(elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars.
* elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
* elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
* elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
* elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
* elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove
local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32
or PCPLT10 relocs. Don't subtract twice on PLT32 relocs.
Formatting.
* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
(ppc64_elf_check_relocs): Use it. Correct comment. Move SEC_ALLOC
test.
(ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
(allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
and optimize. Use ELIMINATE_COPY_RELOCS.
(ppc64_elf_relocate_section): Likewise.
* elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
(ppc_elf_copy_indirect_symbol): Copy pc_count field.
(ELIMINATE_COPY_RELOCS): Define.
(ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
(MUST_BE_DYN_RELOC): Define.
(allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
and optimize. Trim dyn_relocs.
(ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
not be used. Do generate dyn_relocs for copy reloc avoidance. Keep
track of pc_rel dyn relocs.
(ppc_elf_relocate_section): Remove "will_become_local". Adjust
WILL_CALL_FINISH_DYNAMIC_SYMBOL use. Trim dyn relocs as per
allocate_dynrelocs. Don't recalculate "sec".
2003-02-18 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
* elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
on invalid LD relocs.
(allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
(ppc64_elf_relocate_section): Unify new handling of LD relocs and
tlsld_got entry. Use IS_PPC64_TLS_RELOC.
* elf32-ppc.h: New file.
* elf32-ppc.c: Include elf32-ppc.h.
(NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
(struct ppc_elf_link_hash_entry): Rename "root" to "elf". Adjust uses.
Add "tls_mask" field.
(TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
(struct ppc_elf_link_hash_table): Rename "root" to "elf". Adjust uses.
Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
Make use of htab shortcuts throughout file.
(ppc_elf_link_hash_newfunc): Init tls_mask field.
(ppc_elf_link_hash_table_create): Init new fields.
(ppc_elf_copy_indirect_symbol): Copy tls_mask.
(ppc_elf_howto_raw): Add tls relocs.
(ppc_elf_reloc_type_lookup): Handle them.
(ppc_elf_unhandled_reloc): New function.
(ppc_elf_create_got): Stash got section pointer in hash table,
return status. Make .rela.got too.
(ppc_elf_create_dynamic_sections): Stash section pointers in htab.
(ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
NON_GOT_REF set. Don't allocate space in .plt here..
(allocate_dynrelocs): ..do so here instead, properly ref-counting and
not allocating plt entries unnecessarily. Allocate got entries here.
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
(ppc_elf_size_dynamic_sections): Allocate local got entries. Pass
"info" during allocate_dynrelocs hash traversal. Use htab section
shortcuts rather than searching for named sections. Get rid of
"plt" and "strip" booleans.
(update_local_sym_info, bad_shared_reloc): New functions.
(ppc_elf_check_relocs): Handle TLS relocs. Move .rela.got creation to
ppc_elf_create_got. Don't mark got or plt reloc syms dynamic, do so
in allocate_dynreloc. Use update_local_sym_info and bad_shared_reloc.
|