Commit Graph

443 Commits

Author SHA1 Message Date
Alan Modra 7d4c687d56 Control powerpc64-ld provision of register save/restore
This patch allows the user to override powerpc64-ld's default for
providing linker generated register save and restore functions as used
by gcc -Os code.  Normally these are not provided by ld -r, so Linux
kernel modules have needed to include their own copies.

bfd/
	* elf64-ppc.h (struct ppc64_elf_params): Add save_restore_funcs.
	* elf64-ppc.c (ppc64_elf_func_desc_adjust): Use it to control
	provision of out-of-line register save/restore routines.
ld/
	* emultempl/ppc64elf.em (params): Init new field.
	(ppc_create_output_section_statements): Set params.save_restore_funcs
	default.
	(PARSE_AND_LIST_*): Add support for --save-restore-funcs and
	--no-save-restore-funcs.
2014-02-19 14:53:50 +10:30
Alan Modra e7d1c40ce5 Consolidate ppc64 ld/bfd communication
Moves assorted variables used to communicate between ld and bfd into
a struct, hooks it into the bfd link_hash_table early, and removes
all other places where such variables were passed piecemeal.

bfd/
	* elf64-ppc.h (struct ppc64_elf_params): Define.
	(ppc64_elf_init_stub_bfd, ppc64_elf_edit_opd, ppc64_elf_tls_setup,
	ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
	ppc64_elf_build_stubs): Update prototype.
	* elf64-ppp.c (struct ppc_link_hash_table): Add params, delete other
	fields now in params.  Adjust code throughout file.
	(ppc64_elf_init_stub_bfd): Delete "abfd" parameter, add "params".
	Save params pointer in htab.
	(ppc64_elf_edit_opd, ppc64_elf_tls_setup,
	ppc64_elf_setup_section_lists, ppc64_elf_size_stubs,
	ppc64_elf_build_stubs): Remove parameters now in "params".
ld/
	* emultemps/ppc64elf.em (params): New static struct replacing
	various other static vars.  Adjust code throughout file.
2014-02-17 17:11:11 +10:30
Alan Modra b407645f7e PR15530, mark symbol in executables if it matches dynamic_list
For powerpc64 as HJ did earlier for other ELF targets, and a tidy.

	PR gold/15530
	* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
	--export-dynamic and --dynamic-list marking of symbols.
	* elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder
	cheap tests first.
2014-02-12 22:10:09 +10:30
Jan Kratochvil 2915c55b41 Fix PowerPC targets minor memory leaks found by Coverity
bfd/
2014-02-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* coff-rs6000.c (xcoff_write_archive_contents_big): Free OFFSETS in
	return paths.  Three times.
	* elf64-ppc.c (ppc64_elf_link_hash_table_create): Free HTAB in all
	return paths.
	(ppc64_elf_tls_optimize): Free TOC_REF in return path.
	(ppc64_elf_edit_toc): Free USED in return path.
2014-02-04 20:17:16 +01:00
Alan Modra 3ba720c788 Fixes powerpc64le ld segfaults when --emit-relocs is used.
ELFv2 needs fewer relocs to annotate plt call stubs.  I correctly
allocated a smaller buffer and wrote the proper relocs, but stupidly
bumped the reloc count as for ELFv1.

	* elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed
	to get_relocs for ELFv2.
2014-01-24 14:26:39 +10:30
Alan Modra eb8d7fda36 Comment typo
* elf64-ppc.c (STK_LINKER): Comment typo fix.
2014-01-22 16:21:33 +10:30
H.J. Lu 782450358d Default elf_backend_post_process_headers to set OSABI
* elf-bfd.h (_bfd_elf_set_osabi): Renamed to ...
	(_bfd_elf_post_process_headers): This.
	* elf.c (_bfd_elf_compute_section_file_positions): Always
	call elf_backend_post_process_headers.
	(_bfd_elf_set_osabi): Renamed to ...
	(_bfd_elf_post_process_headers): This.
	* elf32-hppa.c (elf_backend_post_process_headers): Removed.
	* elf32-i370.c (elf_backend_post_process_headers): Likewise.
	* elf32-msp430.c (elf_backend_post_process_headers): Likewise.
	* elf32-ppc.c (elf_backend_post_process_headers): Likewise.
	* elf32-sparc.c (elf_backend_post_process_headers): Likewise.
	* elf64-hppa.c (elf_backend_post_process_headers): Likewise.
	* elf64-ppc.c (elf_backend_post_process_headers): Likewise.
	* elf64-sparc.c (elf_backend_post_process_headers): Likewise.
	* elf64-x86-64.c (elf_backend_post_process_headers): Likewise.
	*  (elf_backend_post_process_headers): Likewise.
	*  (elf_backend_post_process_headers): Likewise.
	* elf32-i386.c (elf_backend_post_process_headers): Don't
	define as _bfd_elf_set_osabi.
	(elf_i386_fbsd_post_process_headers): Updated.
	* elf32-mips.c (elf_fbsd_post_process_headers): Removed.
	(elf_backend_post_process_headers): Likewise.
	* elf32-tic6x.c (elf32_tic6x_set_osabi): Removed.
	(elf_backend_post_process_headers): Likewise.
	* elf64-mips.c (elf_fbsd_post_process_headers): Removed.
	(elf_backend_post_process_headers): Likewise.
	* elfn32-mips.c (elf_fbsd_post_process_headers): Removed.
	(elf_backend_post_process_headers): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_post_process_headers): Updated.
	* elfxx-target.h (elf_backend_post_process_headers): Default
	to _bfd_elf_post_process_headers.
2013-12-17 13:41:17 -08:00
Andreas Schwab 1a1fb62757 Fix missing newline in error message
* elf64-ppc.c (ppc64_elf_relocate_section): Add newline to error
message.
2013-12-16 17:28:54 +01:00
Alan Modra 00f412ee52 More PowerPC64 ELFv2 --just-symbols fixes
I don't know what I was thinking here to omit the save of r2.
Possibly I was looking at -msave-toc-indirect code at the time, where
r2 is saved in the function prologue.

	* elf64-ppc.c (ppc_build_one_stub <ppc_stub_plt_branch_r2off>):
	Don't omit saving of r2 for ELFv2.  Don't addi 2,2,0.
	(ppc_size_one_stub <ppc_stub_plt_branch_r2off>): Adjust to suit.
2013-12-03 18:02:44 +10:30
Alan Modra 2c3f079f58 PowerPC64 linking of --just-symbols objects (klibc)
With -mcmodel=medium we can't assume that a -R object doesn't use
toc-relative addressing if there's no toc.  Lots of things are
accessed via r2, not just the toc/got section.  Also, testing for
.opd is plain wrong for ELFv2.

	* elf64-ppc.c (ppc64_elf_link_just_syms): Remove .got check.
	Handle ELFv2.
2013-12-03 15:16:12 +10:30
Alan Modra 14b5f73fac PowerPC64 ELFv2, allocate dynreloc space for ifunc
* elf64-ppc.c (allocate_dynrelocs): Revert 2013-11-04 change.
2013-11-11 14:33:01 +10:30
Alan Modra afe397ea85 Correct elf64-ppc.c handling of protected symbols
Some places in elf64-ppc.c carelessly used SYMBOL_CALLS_LOCAL when
the proper test is SYMBOL_REFERENCES_LOCAL for cases where we take the
address of a protected symbol.  This works OK for function descriptors
but not for ELFv2.  Setting symbols to their global entry stub a
little earlier is to ensure _bfd_elf_hash_symbol allows such symbols
in .gnu.hash.

	* elf64-ppc.c (ppc64_elf_edit_toc): Use SYMBOL_REFERENCES_LOCAL
	here, not SYMBOL_CALLS_LOCAL.
	(ppc64_elf_relocate_section): Likewise.
	(size_global_entry_stubs): Set undefined symbols on their global
	entry stubs here..
	(build_global_entry_stubs): ..rather than here.
	(ppc64_elf_build_stubs): Don't reset glink->size before calling
	build_global_entry_stubs.
2013-11-11 14:31:58 +10:30
H.J. Lu 62d887d406 Pass ignored unresolved relocations to ld backend
bfd/

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-epiphany.c (epiphany_elf_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-lm32.c (lm32_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-metag.c (elf_metag_relocate_section): Likewise.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-mep.c (mep_elf_relocate_section): Likewise.
	* elf32-moxie.c (moxie_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-rl78.c (rl78_elf_relocate_section): Likewise.
	* elf32-rx.c (rx_elf_relocate_section): Likewise.
	* elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
	* elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
	* elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.

	* elfnn-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/testsuite/

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.
	* ld-ia64/error2.d: Likewise.
	* ld-ia64/error3.d: Likewise.
2013-11-05 10:29:44 -08:00
Alan Modra dba6fa9bce Hide ppc64 .TOC. from --export-dynamic
I can't see any good reason why anyone would want a dynamic .TOC., so
hide it in a way that is respected by _bfd_elf_export_symbol.  This
also fixes an abort in relocate_section on not finding sreloc for .TOC.

	* elf64-ppc.c (ppc64_elf_func_desc_adjust): Make .TOC. defined and
	hidden.
	(ppc64_elf_set_toc): Adjust.
2013-11-05 12:44:54 +10:30
Alan Modra 33e44f2eb2 Update elf64-ppc.c to use elf_link_hash_table shortcuts.
These shortcuts to dynamic sections in ppc_link_hash_table predated
their geneneric elf hash table equivalents.

	* elf64-ppc.c (struct ppc_link_hash_table): Remove got, plt, relplt,
	iplt, reliplt.  Update all references to use elf.sgot, elf.splt,
	elf.srelplt, elf.iplt and elf.irelplt.
2013-11-05 12:26:28 +10:30
Alan Modra 52a82034ac Edit ELFv2 global entry prologue to non-PIC
Changing addis r2,r12,..; addi r2,r2,.. to lis r2,..; addi r2,r2..
in non-PIC executables has the benefit of removing a dependency on r12.

bfd/
	* elf64-ppc.c (ppc64_elf_relocate_section): Edit global entry
	prologue to non-PIC in non-PIC executables.
ld/testsuite/
	* ld-powerpc/elfv2exe.d: Adjust for non-PIC global entry.
2013-11-04 10:21:32 +10:30
Alan Modra a345bc8d31 PowerPC64 ELFv2 symbols defined in plt
In a non-pic executable, ELFv2 like other targets, needs to emit a plt
entry even for non-call references to functions defined in shared
libraries, and define the function on the plt code.

	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Copy
	pointer_equality_needed flag.
	(ppc64_elf_check_relocs): For ELFv2 arrange to emit plt
	entries for references to functions in shared libraries on
	non-call relocs.
	(readonly_dynrelocs): Split into function of the same name and..
	(maybe_set_textrel): ..this new function.  Update call.
	(ppc64_elf_adjust_dynamic_symbol): Don't emit dynrelocs for
	ELFv2 in most cases if we have a plt entry.  Use new
	readonly_relocs.
	(allocate_dynrelocs): For ELFv2, don't allocate dynreloc space
	for ifunc in static executables.
	(size_global_entry_stubs): New function.
	(ppc64_elf_size_dynamic_sections): Call size_global_entry_stubs.
	Save end of glink branch table.
	(ppc64_elf_hash_symbol): New function.
	(build_global_entry_stubs): New function.
	(ppc64_elf_build_stubs): Call build_global_entry_stubs.  Adjust
	glink sizing.
	(ppc64_elf_relocate_section): Tidy plt16/32/64 reloc code.
	(ppc64_elf_finish_dynamic_symbol): For ELFv2, adjust symbols
	defined on plt code.
2013-11-04 10:20:09 +10:30
Alan Modra 8b974ba3e8 Simplify ppc64 code setting toc_off.
Every function has a nominal toc pointer value, even if it isn't used,
so set toc_off for every code section to the value used in that object
file.  The thinking here was that if a code section didn't use the toc
it could use the previous object file's toc pointer value.  It can,
but doing so is only a gain if functions in that section are called
mostly from previous objects sharing the same toc.  We lose if the
functions in question are called mostly from the current object or
following objects, and it's a good bet they will probably mostly be
called from the current object.

	* elf64-ppc.c (ppc64_elf_next_input_section): Always set toc_off
	to value for object file.
2013-11-02 11:57:55 +10:30
Alan Modra e8910a83af Replace DT_PPC_TLSOPT with DT_PPC_OPT.
This removes the DT_PPC_TLSOPT/DT_PPC64_TLSOPT dynamic tag and replaces
it with DT_PPC_OPT/DT_PPC64_OPT tag to provide the same functionality
and more.  This isn't backwards compatible, but the TLSOPT tag hasn't
been used since the tls optimisation support was never submitted to
glibc.

/include/elf/
	* ppc.h (DT_PPC_TLSOPT): Delete.
	(DT_PPC_OPT, PPC_OPT_TLS): Define.
	* ppc64.h (DT_PPC64_TLSOPT): Delete.
	(DT_PPC64_OPT, PPC64_OPT_TLS, PPC64_OPT_MULTI_TOC): Define.
bfd/
	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Use new DT_PPC_OPT
	tag to specify tls optimisation.
	* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
	(ppc64_elf_finish_dynamic_sections): Specify whether multiple
	toc pointers are used via DT_PPC64_OPT.
binutils/
	* readelf.c (get_ppc_dynamic_type): Replace PPC_TLSOPT with PPC_OPT.
	(get_ppc64_dynamic_type): Replace PPC64_TLSOPT with PPC64_OPT.
2013-10-30 13:43:32 +10:30
Alan Modra a078d95abc Support ELFv2 stack frame.
The toc pointer save slot changes on ELFv2 from 40(1) to 24(1).

	* elf64-ppc.c (STK_LR, STK_TOC, STK_LINKER): Define.
	(savegpr0_tail, restgpr0_tail, savefpr0_tail, restfpr0_tail)
	build_plt_stub, build_tls_get_addr_stub, ppc_build_one_stub,
	ppc64_elf_relocate_section): Use new defines.
2013-10-30 13:41:57 +10:30
Alan Modra b9e5796b0d ELFv2 stub, plt and glink changes
An ELFv2 PLT entry is simply the address of the target function rather
than three (or two) words to specify entry, toc and static chain.  PLT
call stubs are correspondingly simpler and need no thread safety
barrier.  The glink resolver stub and branch table also is simplified,
a change that could be applied to ELFv1 too, but isn't as yet.

	* elf64-ppc.c (PLT_ENTRY_SIZE, PLT_INITIAL_ENTRY_SIZE): Add htab
	parameter and adjust for ELFv2.  Update all uses.
	(PLT_CALL_STUB_SIZE): Delete.
	(ppc64_elf_get_synthetic_symtab): Support new glink layout.
	(allocate_dynrelocs): Likewise.
	(plt_stub_size, build_plt_stub): Adjust for ELFv2.
	(get_r2off): Return 0 for ELFv2 -R.
	(ppc_build_one_stub, ppc_size_one_stub): Adjust for ELFv2.
	(ppc64_elf_size_stubs): Likewise.
	(ppc64_elf_build_stubs): Add new ELFv2 glink.
2013-10-30 13:41:20 +10:30
Alan Modra 6911b7dcb8 Add ELFv2 .localentry support.
This defines the ELF symbol st_other field used to encode the number
of instructions between a function "global entry" and its "local entry",
and adds support related to the local entry offset.

include/elf/
	* ppc64.h (STO_PPC64_LOCAL_BIT, STO_PPC64_LOCAL_MASK): Define.
	(ppc64_decode_local_entry, ppc64_encode_local_entry): New functions.
	(PPC64_LOCAL_ENTRY_OFFSET, PPC64_SET_LOCAL_ENTRY_OFFSET): Define.
bfd/
	* elf64-ppc.c (struct ppc_stub_hash_entry): Add "other".
	(stub_hash_newfunc): Init new ppc_stub_hash_entry field, and one
	we forgot, "plt_ent".
	(ppc64_elf_add_symbol_hook): Check ELFv1 objects don't have
	st_other bits only valid in ELFv2.
	(ppc64_elf_merge_symbol_attribute): New function.
	(ppc_type_of_stub): Add local_off param to test branch range.
	(ppc_build_one_stub): Adjust destinations for ELFv2 locals.
	(ppc_size_one_stub, toc_adjusting_stub_needed): Similarly.
	(ppc64_elf_size_stubs): Pass local_off to ppc_type_of_stub.
	Set "other" field.
	(ppc64_elf_relocate_section): Adjust destination for ELFv2 local
	calls.
gas/
	* config/tc-ppc.c (md_pseudo_table): Add .localentry.
	(ppc_elf_localentry): New function.
	(ppc_force_relocation): Force relocs on all branches to localenty
	symbols.
	(ppc_fix_adjustable): Don't reduce such symbols to section+offset.
binutils/
	* readelf.c (get_ppc64_symbol_other): New function.
	(get_symbol_other): Use it for EM_PPC64.
2013-10-30 13:40:21 +10:30
Alan Modra ee67d69a3f Add .abiversion related support for ELFv2
Defines bits in ELF e_flags to differentiate ELFv2 objects from ELFv2,
adds .abiversion directive to explicitly choose the ABI, and code to
check and automatically select ABI.

include/elf/
	* ppc64.h (EF_PPC64_ABI): Define.
bfd/
	* elf64-ppc.c (abiversion, set_abiversion): New functions.
	(ppc64_elf_get_synthetic_symtab): Handle ELFv2 objects without .opd.
	(struct ppc_link_hash_table): Add opd_abi.
	(ppc64_elf_check_relocs): Check no .opd with ELFv2.
	(ppc64_elf_merge_private_bfd_data): New function.
	(ppc64_elf_print_private_bfd_data): New function.
	(ppc64_elf_tls_setup): Set htab->opd_abi.
	(ppc64_elf_size_dynamic_sections): Don't emit OPD related dynamic
	tags for ELFv2.
	(ppc_build_one_stub): Use R_PPC64_IRELATIVE for ELFv2 ifunc.
	(ppc64_elf_finish_dynamic_symbol): Likewise
binutils/
	* readelf.c (get_machine_flags): Display ABI version for EM_PPC64.
gas/
	* config/tc-ppc.c: Include elf/ppc64.h.
	(ppc_abiversion): New variable.
	(md_pseudo_table): Add .abiversion.
	(ppc_elf_abiversion, ppc_elf_end): New functions.
	* config/tc-ppc.h (md_end): Define.
2013-10-30 13:37:47 +10:30
Alan Modra 71a39c98f8 Change plt stubs to have destination in r12.
This change is to support the new ELFv2 ABI, which uses the value in
r12 on function entry to calculate the got/toc pointer.

bfd/
	* elf64-ppc.c (build_plt_stub): Switch stubs to use r11 as base
	reg and r12 as destination.
	(ppc_build_one_stub): Likewise.
	(ppc64_elf_build_stubs): Likewise for glink.
ld/testsuite/
	* ld-powerpc/tls.s: Add proper .opd entry for _start.
	* ld-powerpc/tlstoc.s: Likewise.
	* ld-powerpc/relbrlt.d: Update for changed stubs.
	* ld-powerpc/tls.d: Update for changed stubs and _start .opd entry.
	* ld-powerpc/tls.g: Likewise.
	* ld-powerpc/tlsexe.d: Likewise.
	* ld-powerpc/tlsexe.g: Likewise.
	* ld-powerpc/tlsexe.r: Likewise.
	* ld-powerpc/tlsexetoc.d: Likewise.
	* ld-powerpc/tlsexetoc.g: Likewise.
	* ld-powerpc/tlsexetoc.r: Likewise.
	* ld-powerpc/tlsso.d: Likewise.
	* ld-powerpc/tlsso.g: Likewise.
	* ld-powerpc/tlsso.r: Likewise.
	* ld-powerpc/tlstoc.d: Likewise.
	* ld-powerpc/tlstoc.g: Likewise.
	* ld-powerpc/tlstocso.d: Likewise.
	* ld-powerpc/tlstocso.g: Likewise.
	* ld-powerpc/tlstocso.r: Likewise.
2013-10-30 13:35:47 +10:30
Alan Modra f9c6b9078c Report overflow on PowerPC64 @h and @ha relocations.
This changes the behaviour of @h and @ha on PowerPC64 to report errors
on 32-bit overflow.  The motivation for this change is that on
PowerPC64, most uses of @h and @ha modifiers and their corresponding
relocations are to build up 32-bit offsets.  We'd like to know when
such offsets overflow.  Only rarely do people use @h or @ha with the
high 32-bit modifiers to build a 64-bit constant.  Those uses will now
need to use two new modifiers, @high and @higha, if the constant isn't
known at assembly time.  For now, we won't report overflow at assembly
time..

This also fixes an error when applying some of the HIGHER and HIGHEST
relocations.

include/elf/
	* ppc64.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
	R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
	R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): New.
	(IS_PPC64_TLS_RELOC): Match new tls relocs.
bfd/
	* reloc.c (BFD_RELOC_PPC64_ADDR16_HIGH, BFD_RELOC_PPC64_ADDR16_HIGHA,
	BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA,
	BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA): New.
	* elf64-ppc.c (ppc64_elf_howto_raw): Add entries for new relocs.
	Make all _HA and _HI relocs report signed overflow.
	(ppc64_elf_reloc_type_lookup): Handle new relocs.
	(must_be_dyn_reloc, ppc64_elf_check_relocs): Likewise.
	(dec_dynrel_count, ppc64_elf_relocate_section): Likewise.
	(ppc64_elf_relocate_section): Don't apply 0x8000 adjust to
	R_PPC64_TPREL16_HIGHER, R_PPC64_TPREL16_HIGHEST,
	R_PPC64_DTPREL16_HIGHER, and R_PPC64_DTPREL16_HIGHEST.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
gas/
	* config/tc-ppc.c (SEX16): Don't mask.
	(REPORT_OVERFLOW_HI): Define as zero.
	(ppc_elf_suffix): Support @high, @higha, @dtprel@high, @dtprel@higha,
	@tprel@high, and @tprel@higha modifiers.
	(md_assemble): Ignore X_unsigned when applying 16-bit insn fields.
	Add (disabled) code to check @h and @ha reloc overflow for powerpc64.
	Handle new relocs.
	(md_apply_fix): Similarly.
elfcpp/
	* powerpc.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
	R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
	R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): Define.
gold/
	* powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
	(Target_powerpc::Scan::global, local): Likewise.
	(Target_powerpc::Relocate::relocate): Likewise.  Check for overflow
	on all ppc64 @h and @ha relocs.
2013-10-30 13:33:15 +10:30
Alan Modra e5034e59e0 * elf-bfd.h (struct elf_backend_data): Remove as_needed_cleanup.
Add notice_as_needed.
	* elf64-ppc.c (elf_backend_as_needed_cleanup): Don't define.
	(elf_backend_notice_as_needed): Define.
	(ppc64_elf_as_needed_cleanup): Rename and adjust..
	(ppc64_elf_notice_as_needed): ..to this.
	* elflink.c (_bfd_elf_notice_as_needed): New function, extracted..
	(elf_link_add_object_symbols): ..from here.
	* elfxx-target.h (elf_backend_as_needed_cleanup): Don't define.
	(elf_backend_notice_as_needed): Define..
	(elfNN_bed): ..and use here.
2013-08-27 01:06:43 +00:00
Alan Modra 729eabd5c8 * elf64-ppc.c (struct ppc64_elf_obj_tdata): Replace opd_relocs
with a union.
	(opd_entry_value): Cache .opd section contents.
	(ppc64_elf_relocate_section): Adjust.
2013-07-25 15:18:26 +00:00
Alan Modra 5295321caf * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't hide .TOC.
when relocatable.  Don't change root.type or type here.
	(ppc64_elf_set_toc): Set type of .TOC. to STT_OBJECT.
2013-07-03 09:42:56 +00:00
Alan Modra ba8ca3e739 bfd/
* elf64-ppc.c (struct ppc_stub_hash_entry): Delete "addend".
	(ppc64_elf_size_stubs): Don't set "addend".
	(ppc64_elf_relocate_section): Don't allow calls via
	toc-adjusting stubs without a following nop even in an
	executable, except for self-calls and both libc_start_main
	and .libc_start_main.
gold/
	* powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
	comment.
2013-07-03 02:22:35 +00:00
Alan Modra c66bb0eea0 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Hide ".TOC.". 2013-07-03 00:45:50 +00:00
Alan Modra f40da81ba5 bfd/
* elf64-ppc.c (ppc64_elf_relocate_section): Set "relocation" for
	.TOC. after relocatable check.
gas/
	* config/tc-ppc.c (ppc_elf_adjust_symtab): Don't make .TOC. weak.
2013-07-02 00:25:08 +00:00
Alan Modra 1c865ab2fb bfd/
* elf64-ppc.h (ppc64_elf_toc): Delete.
	(ppc64_elf_set_toc): Declare.
	* elf64-ppc.c (ppc64_elf_toc_reloc): Replace call to ppc64_elf_toc
	with call the ppc64_elf_set_toc.
	(ppc64_elf_toc_ha_reloc, ppc64_elf_toc64_reloc): Likewise.
	(ppc64_elf_start_multitoc_partition): Likewise.
	(struct ppc_link_hash_table): Delete dot_toc_dot.  Replace all uses
	with elf.hgot.
	(ppc64_elf_process_dot_syms): Don't make a fake function descriptor
	for ".TOC.".
	(ppc64_elf_check_relocs): Mark sections with a reference to .TOC.
	as needing a toc pointer.
	(ppc64_elf_size_stubs): Don't set dot_toc_dot here.
	(ppc64_elf_set_toc): Rename from ppc64_elf_toc.  Add info param.
	Set elf.hgot value.
ld/
	* emultempl/ppc64elf.em: (ppc_layout_sections_again): Call
	ppc64_elf_set_toc rather than ppc64_elf_toc/_bfd_set_gp_value.
	(gld${EMULATION_NAME}_after_allocation): Likewise.
2013-07-01 03:45:05 +00:00
Alan Modra 128205bb36 * elf64-ppc.c (opd_entry_value): Handle case where symbol
hashes are not available.
2013-05-06 09:32:55 +00:00
Alan Modra bfeb4a285a bfd/
* elf64-ppc.c (ppc64_elf_check_relocs): Don't call
	create_linkage_sections here..
	(ppc64_elf_init_stub_bfd): ..do so here.  Return status.
	(create_linkage_sections): Move earlier in file.
	(ppc64_elf_setup_section_lists): Remove now useless htab->brlt test.
	* elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto.
ld/
	* emultempl/ppc64elf.em (ppc_create_output_section_statements):
	Check return from ppc64_elf_init_stub_bfd.
ld/testsuite/
	* ld-powerpc/tlsexe.d: Adjust.
	* ld-powerpc/tlsexe.r: Adjust.
	* ld-powerpc/tlsexetoc.d: Adjust.
	* ld-powerpc/tlsexetoc.r: Adjust.
	* ld-powerpc/tlsso.d: Adjust.
	* ld-powerpc/tlsso.r: Adjust.
	* ld-powerpc/tlstocso.d: Adjust.
	* ld-powerpc/tlstocso.r: Adjust.
2013-04-22 03:11:40 +00:00
Alan Modra 198f1157c9 * elf32-ppc.c (ppc_elf_check_relocs): Use SYMBOLIC_BIND.
* elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count): Likewise.
2013-04-06 06:44:45 +00:00
Alan Modra 81fbe831fe PR ld/15323
bfd/
	* elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for
	global symbols referenced by relocs.
	* elf32-arm.c (elf32_arm_check_relocs): Likewise.
	* elf32-bfin.c (bfin_check_relocs): Likewise.
	* elf32-cr16.c (cr16_elf_check_relocs): Likewise.
	* elf32-cris.c (cris_elf_check_relocs): Likewise.
	* elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
	* elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
	* elf32-fr30.c (fr30_elf_check_relocs): Likewise.
	* elf32-frv.c (elf32_frv_check_relocs): Likewise.
	* elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
	* elf32-i370.c (i370_elf_check_relocs): Likewise.
	* elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
	* elf32-lm32.c (lm32_elf_check_relocs): Likewise.
	* elf32-m32c.c (m32c_elf_check_relocs): Likewise.
	* elf32-m32r.c (m32r_elf_check_relocs): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
	* elf32-m68k.c (elf_m68k_check_relocs): Likewise.
	* elf32-mcore.c (mcore_elf_check_relocs): Likewise.
	* elf32-metag.c (elf_metag_check_relocs): Likewise.
	* elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
	* elf32-moxie.c (moxie_elf_check_relocs): Likewise.
	* elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
	* elf32-mt.c (mt_elf_check_relocs): Likewise.
	* elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
	* elf32-openrisc.c (openrisc_elf_check_relocs): Likewise.
	* elf32-ppc.c (ppc_elf_check_relocs): Likewise.
	* elf32-rl78.c (rl78_elf_check_relocs): Likewise.
	* elf32-s390.c (elf_s390_check_relocs): Likewise.
	* elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
	* elf32-sh.c (sh_elf_check_relocs): Likewise.
	* elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
	* elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
	* elf32-v850.c (v850_elf_check_relocs): Likewise.
	* elf32-vax.c (elf_vax_check_relocs): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
	* elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
	* elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
	* elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
	* elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
	* elf64-mmix.c (mmix_elf_check_relocs): Likewise.
	* elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
	* elf64-s390.c (elf_s390_check_relocs): Likewise.
	* elf64-sh64.c (sh_elf64_check_relocs): Likewise.
	* elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
	* elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.  Don't
	test indirect/warning links for NULL.
ld/testsuite/
	* ld-plugin/lto.exp (pr15323a.c): Compile without -flto rather
	than using -r to effectively strip out lto info.
2013-03-30 10:14:15 +00:00
Alan Modra 19e08130ee * elf64-ppc.c (struct ppc_dyn_relocs): New.
(ppc64_elf_check_relocs): Separate dynrel counts for local syms
	into ifunc and non-ifunc.
	(dec_dynrel_count): Pass in sym rather than sym_sec.  Handle
	separate ifunc/non-ifunc dynrel counts.
	(allocate_got): Always use reliplt for ifunc.
	(allocate_dynrelocs): Likewise.
	(ppc64_elf_size_dynamic_sections): Likewise.
	(ppc64_elf_layout_multitoc): Likewise.
	(ppc64_elf_relocate_section): Likewise.
2013-03-28 13:36:32 +00:00
Alan Modra 7e612e9848 * elf-bfd.h (enum elf_reloc_type_class): Add reloc_class_ifunc.
(struct elf_backend_data <elf_backed_reloc_type_class>): Add
	bfd_link_info* and asection* params.
	(_bfd_elf_reloc_type_class): Likewise.
	* elf.c (_bfd_elf_reloc_type_class): Likewise.
	* elflink.c (elf_link_sort_cmp2): Sort first on reloc class.
	(elf_link_sort_relocs): Update elf_backed_reloc_type_class call.
	* elf32-ppc.c (ppc_elf_reloc_type_class): Return reloc_class_ifunc
	for any reliplt reloc.  Don't return reloc_class_plt for
	R_PPC_REL24 and R_PPC_ADDR24.
	* elf64-ppc.c (allocate_got): Formatting.
	(ppc64_elf_reloc_type_class): Return reloc_class_ifunc for any
	reliplt reloc.
	* elf-m10300.c, * elf32-arm.c, * elf32-bfin.c, * elf32-cr16.c,
	* elf32-cris.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c,
	* elf32-m32r.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
	* elf32-s390.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilepro.c,
	* elf32-vax.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-alpha.c,
	* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-s390.c, * elf64-sparc.c,
	* elf64-x86-64.c, * elfnn-ia64.c, * elfxx-tilegx.c, * elfxx-tilegx.h:
	Add extra params to the various reloc_type_class functions.
2013-03-27 13:37:51 +00:00
Alan Modra 228e534f16 * elf-bfd.h (struct core_elf_obj_tdata): New.
(struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid,
	core_program, and core_command.  Add "core".
	* elf.c (bfd_elf_mkcorefile): Allocate "core" struct.
	Update all refs to tdata core fields.
	* elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c,
	* elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c,
	* elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c,
	* elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c,
	* elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c,
	* elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c,
	* elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs
	to tdata core fields.
2013-02-21 03:02:30 +00:00
Alan Modra 9f7c3e5e99 * elfcode.h (elf_checksum_contents): Free contents.
* elf-bfd.h (_bfd_elf_link_hash_table_free): Declare.
	* elflink.c (_bfd_elf_link_hash_table_free): New function.
	(elf_final_link_free): New function, extracted from..
	(bfd_elf_final_link): ..here.  Always call
	_bfd_elf_write_section_eh_frame_hdr.
	* elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Default to
	_bfd_elf_link_hash_table_free.
	* libbfd-in.h (_bfd_merge_sections_free): Declare.
	* libbfd.h: Regenerate.
	* merge.c (_bfd_merge_sections_free): New function.
	* elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Free
	hdr_info->array.
	* elf-m10300.c (elf32_mn10300_link_hash_table_free): Call
	_bfd_elf_link_hash_table_free.
	* elf32-arm.c (elf32_arm_link_hash_table_free): Likewise.
	* elf32-avr.c (elf32_avr_link_hash_table_free): Likewise.
	* elf32-hppa.c (elf32_hppa_link_hash_table_free): Likewise.
	* elf32-i386.c (elf_i386_link_hash_table_free): Likewise.
	* elf32-m68hc1x.c (m68hc11_elf_hash_table_free): Likewise.
	* elf32-m68k.c (elf_m68k_link_hash_table_free): Likewise.
	* elf32-metag.c (elf_metag_link_hash_table_free): Likewise.
	* elf32-xgate.c (xgate_elf_bfd_link_hash_table_free): Likewise.
	* elf64-aarch64.c (elf64_aarch64_link_hash_table_free): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_hash_table_free): Likewise.
	* elf64-ppc.c (ppc64_elf_link_hash_table_free): Likewise.
	* elf64-x86-64.c (elf_x86_64_link_hash_table_free): Likewise.
	* elfnn-ia64.c (elfNN_ia64_hash_table_free): Likewise.
	* elf32-cr16.c (elf32_cr16_link_hash_table_free): Delete.
	(bfd_elf32_bfd_link_hash_table_free): Don't define.
	* elf32-tic6x.c (elf32_tic6x_link_hash_table_free): Delete.
	(bfd_elf32_bfd_link_hash_table_free): Dont' define.
2013-02-11 05:30:54 +00:00
Alan Modra c57da1a761 * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
clears def_regular.
2013-02-01 11:06:37 +00:00
Alan Modra bcaa2f8235 bfd/
* elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
ld/testsuite/
	* ld-powerpc/tlsexe.d: Update for changed stub names.
	* ld-powerpc/tlsexe.r: Likewise.
	* ld-powerpc/tlsexetoc.d: Likewise.
	* ld-powerpc/tlsexetoc.r: Likewise.
	* ld-powerpc/tlsso.d: Likewise.
	* ld-powerpc/tlsso.r: Likewise.
	* ld-powerpc/tlstocso.d: Likewise.
	* ld-powerpc/tlstocso.r: Likewise.
2013-01-31 06:28:48 +00:00
Alan Modra 22aa0c7ed3 * elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink. 2013-01-30 22:31:31 +00:00
Alan Modra bc30df1657 * elf64-ppc.c: Use %T to print symbols names and remove redundant
"relocation" in error messages throughout file.
	(ppc64_elf_relocate_section): Remove sibling call error message,
	replace with "call lacks nop".  Specially report errors for
	branches to function entry points via OPD lookup and branches
	to stubs.  Remove NULL symbol handling now done by %T.
2013-01-28 12:30:17 +00:00
Alan Modra e245874365 bfd/
* elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
	plt-thread-safe.
gold/
	* powerpc.cc (Target_powerpc::do_relax): Default shared libs to
	plt-thread-safe.
ld/testsuite/
	* ld-powerpc/tlsso.d: Adjust for plt-thread-safe stubs.
	* ld-powerpc/tlsso.g: Likewise.
	* ld-powerpc/tlsso.r: Likewise.
	* ld-powerpc/tlstocso.d: Likewise.
	* ld-powerpc/tlstocso.g: Likewise.
2013-01-15 06:13:26 +00:00
H.J. Lu 68ffbac672 Remove trailing white spaces in bfd
* aout0.c: Remove trailing white spaces.
	* archive.c: Likewise.
	* archures.c: Likewise.
	* bfd-in.h: Likewise.
	* bfd-in2.h: Likewise.
	* coff-alpha.c: Likewise.
	* coff-i860.c: Likewise.
	* coff-mips.c: Likewise.
	* coff-ppc.c: Likewise.
	* coff-tic80.c: Likewise.
	* coff-x86_64.c: Likewise.
	* coff-z80.c: Likewise.
	* coffcode.h: Likewise.
	* coffgen.c: Likewise.
	* cofflink.c: Likewise.
	* compress.c: Likewise.
	* corefile.c: Likewise.
	* cpu-arm.c: Likewise.
	* cpu-avr.c: Likewise.
	* cpu-bfin.c: Likewise.
	* cpu-cr16.c: Likewise.
	* cpu-cr16c.c: Likewise.
	* cpu-crx.c: Likewise.
	* cpu-h8300.c: Likewise.
	* cpu-i386.c: Likewise.
	* cpu-lm32.c: Likewise.
	* cpu-m68k.c: Likewise.
	* cpu-moxie.c: Likewise.
	* cpu-msp430.c: Likewise.
	* cpu-sh.c: Likewise.
	* cpu-xc16x.c: Likewise.
	* dwarf2.c: Likewise.
	* ecofflink.c: Likewise.
	* ecoffswap.h: Likewise.
	* elf-ifunc.c: Likewise.
	* elf-m10300.c: Likewise.
	* elf-vxworks.c: Likewise.
	* elf32-avr.c: Likewise.
	* elf32-avr.h: Likewise.
	* elf32-cr16.c: Likewise.
	* elf32-cr16c.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-crx.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i860.c: Likewise.
	* elf32-ip2k.c: Likewise.
	* elf32-iq2000.c: Likewise.
	* elf32-m32c.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-msp430.c: Likewise.
	* elf32-mt.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-score.h: Likewise.
	* elf32-sh-symbian.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-spu.c: Likewise.
	* elf32-tic6x.c: Likewise.
	* elf32-v850.c: Likewise.
	* elf32-xc16x.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elfcore.h: Likewise.
	* elflink.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* elfxx-tilegx.c: Likewise.
	* ieee.c: Likewise.
	* libcoff.h: Likewise.
	* libpei.h: Likewise.
	* libxcoff.h: Likewise.
	* linker.c: Likewise.
	* mach-o-i386.c: Likewise.
	* mach-o-target.c: Likewise.
	* mach-o.c: Likewise.
	* mach-o.h: Likewise.
	* mmo.c: Likewise.
	* opncls.c: Likewise.
	* pdp11.c: Likewise.
	* pe-x86_64.c: Likewise.
	* peXXigen.c: Likewise.
	* pef-traceback.h: Likewise.
	* pei-x86_64.c: Likewise.
	* peicode.h: Likewise.
	* plugin.c: Likewise.
	* reloc.c: Likewise.
	* riscix.c: Likewise.
	* section.c: Likewise.
	* som.c: Likewise.
	* syms.c: Likewise.
	* tekhex.c: Likewise.
	* ticoff.h: Likewise.
	* vaxbsd.c: Likewise.
	* xcofflink.c: Likewise.
	* xtensa-isa.c: Likewise.
2013-01-10 20:03:55 +00:00
Alan Modra 68d6295870 * elf64-ppc.c (build_plt_stub): Fix off by one error in branch
to glink.
2012-12-05 04:58:51 +00:00
Alan Modra a38a07e07c bfd/
* elf64-ppc.c (struct ppc_link_hash_table): Add dot_toc_dot.
	(ppc64_elf_size_stubs): Lookup ".TOC.".
	(ppc64_elf_relocate_section): Resolve special symbol ".TOC.".
gas/
	* config/tc-ppc.c (ppc_elf_adjust_symtab): New function, split out..
	(ppc_frob_file_before_adjust): ..from here.
	(md_apply_fix): Set BSF_KEEP on .TOC. if not @tocbase.
	* config/tc-ppc.h (ppc_elf_adjust_symtab): Declare.
	(tc_adjust_symtab): Define.
2012-11-06 05:18:03 +00:00
Alan Modra 53d8967a85 * elf64-ppc.c (maybe_strip_output): Heed SEC_KEEP. 2012-11-06 03:44:51 +00:00
Alan Modra d4f1ee75e7 * elf64-ppc.c (ppc64_elf_edit_toc): Clear "repeat" inside
loop.  Really mark toc entry referring to another toc entry
	only if the first is used.
2012-11-05 05:17:34 +00:00