aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-spu.c
AgeCommit message (Collapse)AuthorFilesLines
2009-08-05bfd/Trevor Smigiel1-0/+135
* elf32-spu.h (spu_elf_params): Add member emit_fixups. (spu_elf_size_sections): Declare prototype. * elf32-spu.c (spu_link_hash_table): Add member sfixup. (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros. (spu_elf_emit_fixup): New function. (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32. (spu_elf_size_sections): New function. ld/ * emulparams/elf32_spu.sh (OTHER_READONLY_SECTIONS): Add .fixup section and __fixup_start symbol. * emultempl/spuelf.em (params): Initialize emit_fixups member. (spu_before_allocation): Call spu_elf_size_sections. (OPTION_SPU_EMIT_FIXUPS): Define. (PARSE_AND_LIST_LONGOPTS): Add --emit-fixups. (PARSE_AND_LIST_ARGS_CASES): Handle --emit-fixups. * ld.texinfo (--emit-fixups): Document. ld/testsuite/ * ld-spu/fixup.d: New. * ld-spu/fixup.s: New.
2009-07-24include/elf/Trevor Smigiel1-0/+15
* spu.h (R_SPU_ADD_PIC): New. bfd/ * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC. (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC. (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC. gas/ * config/tc-spu.c (md_apply_fix): Handle SPU_ADD_PIC. * config/tc-spu.h (tc_fix_adjustable): Don't adjust for SPU_ADD_PIC. (TC_FORCE_RELOCATION): Emit relocs for SPU_ADD_PIC. ld/testsuite/ * ld-spu/pic.d: New. * ld-spu/pic.s: New. * ld-spu/picdef.s: New.
2009-07-10 * elf32-spu.c (spu_elf_size_stubs): Do set up soft-icache managerAlan Modra1-86/+91
data even when no stubs. (spu_elf_place_overlay_data, spu_elf_build_stubs): Adjust.
2009-07-09 * elf32-spu.c (mark_functions_via_relocs): Init broken_cycle fieldAlan Modra1-0/+3
of malloc'd struct call_info. (pasted_function): Likewise, priority too.
2009-07-07 * elf32-spu.c (spu_elf_auto_overlay): Take into account sectionAlan Modra1-12/+26
alignment when packing sections into overlays.
2009-06-16 * elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bitsUlrich Weigand1-10/+6
also for calls.
2009-06-06 * elf32-spu.c (spu_elf_relocate_section): Match overlay numberAlan Modra1-3/+4
when looking for soft-icache stubs.
2009-05-28 * elf32-spu.c (struct call_info): New member broken_cycle.Ulrich Weigand1-9/+15
(remove_cycle): Instead of physically removing call_info structures to break call graph cycles, mark them using the broken_cycle flag. (mark_overlay_section): Respect broken_cycle flag. (unmark_overlay_section): Likewise. (collect_lib_sections): Likewise. (collect_overlays): Likewise. (sum_stack): Likewise.
2009-05-28 * elf32-spu.c (insert_callee): Accumulate incoming callee->count.Ulrich Weigand1-6/+9
(mark_functions_via_relocs): Initialize callee->count to 1. (pasted_function): Likewise. (spu_elf_auto_overlay): Honor call counts when determining number of stubs required in software i-cache mode.
2009-05-21 * elf-bfd.h (struct elf_backend_dataAlan Modra1-2/+2
<elf_backend_link_output_symbol_hook>): Return an int. * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop symbols on deleted .opd entries. * elflink.c (elf_link_output_sym): Return without outputting sym if output_symbol_hook returns 2. (elf_link_output_extsym): Don't assign h->indx when symbol discarded. Abort if we must not discard sym. (elf_link_input_bfd): Similarly, don't set finfo->indices for local syms. (bfd_elf_final_link): Adjust elf_link_output_sym calls. * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for elf_backend_link_output_symbol_hook return type change. * elf32-arm.c (output_arch_syminfo): Likewise. (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. (elf32_arm_output_arch_local_syms): Likewise. * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. (bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
2009-05-14 * elf32-spu.c (mark_overlay_section): Move .init and .finiUlrich Weigand1-1/+3
sections into the software icache.
2009-05-14bfd/Ulrich Weigand1-53/+25
* elf32-spu.c (build_stub): Always build "compact" sofware i-cache stubs. ld/ * emultempl/spuelf.em (PARSE_AND_LIST_ARGS_CASES): Always use compact stubs with software i-cache. ld/testsuite/ * ld-spu/icache1.d: Update for compact stubs.
2009-05-14bfd/Ulrich Weigand1-40/+94
* elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2. (spu_elf_setup): Initialize it. (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache. Update to new-sytle cache manager data structures. (spu_elf_build_stubs): Generate new-style cache manager data structures and symbols. (spu_elf_auto_overlay): Update size computation. ld/testsuite/ * ld-spu/icache1.d: Update all addresses to accomodate icache buffer shifted down 0x800 bytes.
2009-05-14bfd/Ulrich Weigand1-1/+33
* elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY segments first amongst the program headers. ld/testsuite/ * ld-spu/icache.d: Update file offsets. * ld-spu/ovl.d: Likewise. * ld-spu/ovl1.d: Likewise.
2009-05-14 * elf32-spu.c (spu_elf_relocate_section): Only encode overlay indexUlrich Weigand1-8/+2
into addresses for relocation types that look at high bits. Remove special handling of relocation overflow warnings.
2009-05-14 * elf32-spu.c (mark_functions_via_relocs): Handle cycles in theUlrich Weigand1-1/+8
control flow graph between fragments of a function.
2009-05-14 * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,Ulrich Weigand1-4/+4
generate only a 16-byte .toe section. (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
2009-05-14bfd/Alan Modra1-9/+35
* elf32-spu.c (spu_elf_size_stubs): Split out section placement to.. (spu_elf_place_overlay_data): ..here. New function. * elf32-spu.h (spu_elf_place_overlay_data): Declare. ld/ * emultempl/spuelf.em (spu_before_allocation): Call spu_elf_place_overlay_data. ld/testsuite/ * ld-spu/icache1.d: Update for changed overlay manager placement. * ld-spu/ovl.d: Likewise. * ld-spu/ovl2.d: Likewise.
2009-05-11 * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma asAlan Modra1-2/+12
start of overlays. (spu_elf_build_stubs): Don't define __icache_tagbase. Define __icache_tag_array and __icache_tag_array_size.
2009-03-19bfd/Alan Modra1-69/+59
* elf32-spu.c (spu_elf_find_overlays): Separate error return from "no overlays" return. If there are overlays, create overlay manager entry symbols here, so that.. (spu_elf_build_stubs): ..we don't need to set them up here. Simplify entry symbol tests. * elf32-spu.h (spu_elf_find_overlays): Update prototype. ld/ * emultempl/spuelf.em (spu_before_allocation): Report errors from spu_elf_find_overlays.
2009-03-17bfd/Alan Modra1-101/+130
* elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit. Add compact_stub. (emum _ovly_flavour): Delete ovly_compact, ovly_none. * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and ovly_return fields with ovly_entry[2]. Adjust all users. (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler when soft-icache. (spu_elf_build_stubs): Likewise. (ovl_stub_size): Change arg to spu_elf_params pointer. Adjust for ovly_flavour changes. Update all callers. (ovl_stub_size_log2): New function. (build_stub): Handle compact icache stubs. Use different manager entry point for stubs in non-icache area. (spu_elf_size_stubs): Don't allocate space for indirect branch descriptors. (spu_elf_build_stubs): And don't built them. ld/ * emultempl/spu_icache.S: Add new entry to dummy handler. * emultempl/spu_icache.o_c: Regenerate. * emultempl/spuelf.em (params): Init new field. (no_overlays): New static var. (spu_before_allocation): Use it. (OPTION_SPU_COMPACT_STUBS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add compact-stubs. (PARSE_AND_LIST_ARGS_CASES): Handle compact-stubs. Adjust no-overlays handling. ld/testsuite/ * ld-spu/icache1.d: Update for fixed set_id, new manager entry, and reduced data.
2009-03-15 * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlayUlrich Weigand1-17/+20
parameter just because fixed sections fit into local store. (spu_elf_auto_overlay): Do not declare as "noreturn". Skip generating overlays if fixed sections plus reserved stack and heap space fit into local store.
2009-03-15 * elf32-spu.c (build_stub): Correct icache set_id.Alan Modra1-3/+3
(spu_elf_relocate_section): Likewise.
2009-03-11 * elf32-spu.c (find_function_stack_adjust): Handle sf instructionUlrich Weigand1-0/+13
used to update stack pointer.
2009-02-09 * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.Alan Modra1-8/+14
(find_function): Likewise. (pasted_function): Don't error if no prior function found. (discover_functions): Revert 2008-12-10 change. Extend first function range to start of section.
2009-02-04 * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.Alan Modra1-1/+7
Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
2009-01-21bfd/Alan Modra1-8/+20
* elf32-spu.h (struct spu_elf_params): Add non_ia_text. * elf32-spu.c (mark_overlay_section): Only include .text.ia.* sections in soft-icache lines unless non_ia_text. Don't add rodata if doing so would exceed line size. ld/ * emultempl/spuelf.em (params): Init new field. (OPTION_SPU_NON_IA_TEXT): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --non-ia-text. (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_SPU_NON_IA_TEXT.
2009-01-12 * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.Alan Modra1-2/+2
2009-01-12 * elf32-spu.c (remove_cycles): Always set call->max_depth.Alan Modra1-1/+1
2009-01-12 * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.Alan Modra1-1/+1
2009-01-12bfd/Alan Modra1-272/+914
* elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2, num_lines_log2. (struct got_entry): Add br_addr. (struct call_info): Add priority. (struct function_info): Add lr_store and sp_adjust. (spu_elf_setup): Init line_size_log2 and num_lines_log2. (spu_elf_find_overlays): For soft-icache, mark any section within cache area as an overlay, and check that no other overlays exist. Look up icache overlay manager entry sym. (BRA_STUBS, BRA, BRASL): Define. (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub. (needs_ovl_stub): Adjust for soft-icache. Return priority encoded in branch insn. (count_stub, build_stub): Support soft-icache. (build_spuear_stubs, process_stubs): Adjust build_stub call. (spu_elf_size_stubs): Size soft-icache stubs. (overlay_index): New function. (spu_elf_build_stubs): Make static. Support soft-icache. (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache. (find_function_stack_adjust): Save lr store and stack adjust insn offsets. (maybe_insert_function): Adjust find_function_stack_adjust call. (mark_functions_via_relocs): Retrieve priority. (remove_cycles): Only warn about pruned arcs when stack_analysis. (sort_calls): Sort by priority first. (mark_overlay_section): Ignore .ovl.init. (sum_stack): Only print when stack_analysis. (print_one_overlay_section): New function, extracted from.. (spu_elf_auto_overlay): ..here. Support soft-icache overlays. (spu_elf_stack_analysis): Only print when htab->stack_analysis. (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive analysis. Call spu_elf_build_stubs. (spu_elf_relocate_section): For soft-icache encode overlay index into addresses. (spu_elf_output_symbol_hook): Support soft-icache. (spu_elf_modify_program_headers: Likewise. * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis. Rename num_regions to num_lines. Add line_size and max_branch. (enum _ovly_flavour): Add ovly_soft_icache. (spu_elf_build_stubs): Delete. gas/ * config/tc-spu.c (md_pseudo_table): Add "brinfo". (brinfo): New var. (md_assemble): Poke brinfo into branch instructions. (spu_brinfo): New function. (md_apply_fix): Don't assume insn fields start off at zero, mask them to remove possible brinfo. ld/ * emultempl/spuelf.em (params): Init new fields. (num_lines_set, line_size_set, icache_mgr, icache_mgr_stream): New vars. (spu_place_special_section): Adjust placement for soft-icache. Pad soft-icache section to a fixed size. Clear addr_tree. (spu_elf_load_ovl_mgr): Support soft-icache. Map overlay manager sections a little more intelligently. (gld${EMULATION_NAME}_finish): Don't call spu_elf_build_stubs. (OPTION_SPU_NUM_LINES): Rename from OPTION_SPU_NUM_REGIONS. (OPTION_SPU_SOFT_ICACHE, OPTION_SPU_LINE_SIZE): Define. (OPTION_SPU_LRLIVE): Define. (PARSE_AND_LIST_LONGOPTS): Add new soft-icache options. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Handle them. * emultempl/spu_icache.S: Dummy file. * emultempl/spu_icache.o_c: Regenerate. * Makefile.am (eelf32_spu.c): Depend on spu_icache.o_c. (spu_icache.o_c): Add rule to build. (CLEANFILES): Zap temp files. (EXTRA_DIST): Add spu_icache.o_c. * Makefile.in: Regenerate. ld/testsuite/ * ld-spu/ovl.d: Allow for absolute branches in stubs. * ld-spu/ovl2.d: Likewise.
2008-12-10bfd/Alan Modra1-73/+108
* elf32-spu.h (struct spu_elf_params): Add num_regions. * elf32-spu.c (spu_elf_auto_overlay): Handle multiple overlay regions. ld/ * emultempl/spuelf.em (params): Init new field. (OPTION_SPU_NUM_REGIONS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --num-regions. (PARSE_AND_LIST_ARGS_CASES): Handle --num-regions.
2008-12-10bfd/Alan Modra1-222/+174
* elf32-spu.g (struct spu_elf_params, enum _ovly_flavour): New. (spu_elf_setup): Declare. (spu_elf_create_sections, spu_elf_size_stubs): Update prototype. (spu_elf_build_stubs, spu_elf_check_vma): Likewise. * elf32-spu.c (struct spu_link_hash_table): Add "params". Remove various other fields now in "params". Adjust code throughout. (struct call_info, struct function_info): Move earlier in file. (struct spu_elf_stack_info): Likewise. (spu_elf_setup): New function. (spu_elf_create_sections): Remove args other than "info". (spu_elf_size_stubs, spu_elf_build_stubs, spu_elf_check_vma): Likewise. (maybe_needs_stubs): Remove "output_bfd" arg. Adjust all calls. (interesting_section): Similarly with "obfd" arg. (needs_ovl_stub): Adjust output_section test. (allocate_spuear_stubs): Likewise. (OVL_STUB_SIZE): Don't define. (ovl_stub_size): New function, use in place of OVL_STUB_SIZE. (build_stub): Test params->ovly_flavour rather than OVL_STUB_SIZE. (spu_elf_auto_overlay): Remove args other than "info". Make use of size returned from spu_elf_load_ovl_mgr. (spu_elf_stack_analysis): Remove args other than "info". (spu_elf_relocate_section): Tidy setting of "ea". ld/ * emultempl/spuelf.em (params): New var, used instead of various others. Adjust use throughout file. (spu_after_open): Call spu_elf_setup. (spu_place_special_section): Tidy. (spu_elf_load_ovl_mgr): Return total size of sections loaded. Move code setting overlay section alignment to.. (spu_before_allocation): ..here.
2008-12-10 * elf32-spu.c (define_ovtab_symbol): Don't abort on symbolsAlan Modra1-12/+20
defined in linker scripts. (discover_functions): Consider STT_SECTION symbols too. (collect_lib_sections): Don't cut short call tree traversal when function size is too large.
2008-12-10 * elf32-spu.c (find_function_stack_adjust): Don't limit numberAlan Modra1-12/+50
of insns scanned. Correct sp tests. Handle "fsmbi" and "andbi". (mark_detached_root): New function. (build_call_tree): Call it. (sort_calls): Don't do void* arithmetic.
2008-10-20 * elflink.c (bfd_elf_final_link): Move code reading relocs to..Alan Modra1-6/+17
* elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params. * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs params.
2008-09-29bfd/Alan Modra1-2/+7
PR 6789 * elf.c (assign_file_positions_for_load_sections): Call _bfd_elf_map_sections_to_segments, not elf_modify_segment_map. (get_program_header_size): Protect against NULL info. (_bfd_elf_map_sections_to_segments): Likewise. * elf32-spu.c (spu_elf_additional_program_headers): Likewise. ld/testsuite/ * ld-elf/extract-symbol-1sec.d: Correct section lma.
2008-08-04 * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possibleAlan Modra1-4/+8
if --fixed-space request is too large.
2008-08-02 * elf32-spu.c (mark_overlay_section): Move code calculatingAlan Modra1-9/+12
max_overlay_size to correct block. (spu_elf_auto_overlay): Don't use %x in einfo error message.
2008-07-21 * elf32-spu.c (spu_elf_relocate_section): ExpandAlan Modra1-4/+45
RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for R_SPU_PPU32 and R_SPU_PPU64 relocations.
2008-06-19 * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub forAlan Modra1-1/+1
non-branch insns.
2008-06-19 * elf32-spu.c (build_stub): Allow wraparound on stub branches.Alan Modra1-13/+11
(allocate_spuear_stubs, build_spuear_stubs): Return value from count_stub/build_stub. (spu_elf_build_stubs): Correct location of stub reloc error message.
2008-06-16bfd/Alan Modra1-4/+18
* elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space. (spu_elf_check_vma): Add extra_stack_space param, copy to htab. (spu_elf_auto_overlay): Use it. (RECURSE_UNMARK): Define as 0. (unmark_overlay_section): Heed RECURSE_UNMARK. * elf32-spu.h (spu_elf_check_vma): Update prototype. ld/ * emultempl/spuelf.em (extra_stack_space): New variable. (gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space. * emultempl/spu_ovl.S: Mask interrupts during dma and update of overlay manager structures. * emultempl/spu_ovl.o: Regenerate.
2008-06-07 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below spAlan Modra1-1/+1
to stack calculation.
2008-06-06include/Alan Modra1-38/+31
* bfdlink.h (struct bfd_link_info): Add "path_separator". bfd/ * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that file names be unique. Specify archive:path in overlay script. ld/ * ldlang.c (name_match): New function. (unique_section_p, walk_wild_consider_section): Use it here. (walk_wild_section_general): And here. (archive_path): New function. (walk_wild): Match archive:path filespecs. (open_input_bfds): Don't load archive:path files. * emultempl/spuelf.em (choose_target): Set path_separator. * emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output.
2008-06-04 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.Alan Modra1-31/+19
(process_stubs): Likewise. (discover_functions): Don't used cached symbols. (maybe_insert_function): Correct condition under which function array is realloc'd. (mark_functions_via_relocs): Delete unused variable.
2008-05-28 * elf32-spu.c (spu_elf_object_p): New function.Alan Modra1-25/+60
(elf_backend_object_p): Define. (build_stub): Correct second word of 8 byte overlay stubs. (spu_elf_relocate_section): Formatting.
2008-05-12 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.Alan Modra1-6/+7
2008-05-07bfd/Alan Modra1-8/+29
* elf32-spu.c (spu_elf_special_sections): Add "._ea". (spu_elf_relocate_section): Handle relocations against symbols defined in ._ea specially. binutils/ * embedspu.sh: Take note of R_SPU_PPU32/64 relocs without a symbol, and if present, put image in ".data.speelf". Put program handle in ".data.spehandle". ld/emulparams/ * elf32_spu.sh (OTHER_SECTIONS): Add "._ea". * elf32ppc.sh: If building with spu support, put ".data.spehandle" sections at the start of ".data" and provide a symbol to locate the directory of embedded spe programs. ld/testsuite/ * ld-spu/ear.s: Align various sections. * ld-spu/embed.rd: Update.
2008-04-08 * elf32-spu.c (spu_elf_build_stubs): Correct error message.Alan Modra1-3/+3
(mark_functions_via_relocs): Remove premature init of symtab_hdr. (collect_overlays): Commment typo fix.