1 /* SPU specific support for 32-bit ELF.
3 Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 /* Stash various callbacks for --auto-overlay. */
24 void (*place_spu_section
) (asection
*, asection
*, const char *);
25 bfd_size_type (*spu_elf_load_ovl_mgr
) (void);
26 FILE *(*spu_elf_open_overlay_script
) (void);
27 void (*spu_elf_relink
) (void);
29 /* Bit 0 set if --auto-overlay.
30 Bit 1 set if --auto-relink.
31 Bit 2 set if --overlay-rodata. */
32 unsigned int auto_overlay
: 3;
33 #define AUTO_OVERLAY 1
35 #define OVERLAY_RODATA 4
37 /* Type of overlays, enum _ovly_flavour. */
38 unsigned int ovly_flavour
: 1;
39 unsigned int compact_stub
: 1;
41 /* Set if we should emit symbols for stubs. */
42 unsigned int emit_stub_syms
: 1;
44 /* Set if we want stubs on calls out of overlay regions to
45 non-overlay regions. */
46 unsigned int non_overlay_stubs
: 1;
48 /* Set if lr liveness analysis should be done. */
49 unsigned int lrlive_analysis
: 1;
51 /* Set if stack size analysis should be done. */
52 unsigned int stack_analysis
: 1;
54 /* Set if __stack_* syms will be emitted. */
55 unsigned int emit_stack_syms
: 1;
57 /* Set if non-icache code should be allowed in icache lines. */
58 unsigned int non_ia_text
: 1;
60 /* Range of valid addresses for loadable sections. */
61 bfd_vma local_store_lo
;
62 bfd_vma local_store_hi
;
64 /* Control --auto-overlay feature. */
65 unsigned int num_lines
;
66 unsigned int line_size
;
67 unsigned int max_branch
;
68 unsigned int auto_overlay_fixed
;
69 unsigned int auto_overlay_reserved
;
70 int extra_stack_space
;
73 /* Extra info kept for SPU sections. */
75 struct spu_elf_stack_info
;
77 struct _spu_elf_section_data
79 struct bfd_elf_section_data elf
;
82 /* Info kept for input sections. */
84 /* Stack analysis info kept for this section. */
85 struct spu_elf_stack_info
*stack_info
;
88 /* Info kept for output sections. */
90 /* Non-zero for overlay output sections. */
91 unsigned int ovl_index
;
97 #define spu_elf_section_data(sec) \
98 ((struct _spu_elf_section_data *) elf_section_data (sec))
112 extern void spu_elf_setup (struct bfd_link_info
*, struct spu_elf_params
*);
113 extern void spu_elf_plugin (int);
114 extern bfd_boolean
spu_elf_open_builtin_lib (bfd
**,
115 const struct _ovl_stream
*);
116 extern bfd_boolean
spu_elf_create_sections (struct bfd_link_info
*);
117 extern int spu_elf_find_overlays (struct bfd_link_info
*);
118 extern int spu_elf_size_stubs (struct bfd_link_info
*);
119 extern void spu_elf_place_overlay_data (struct bfd_link_info
*);
120 extern asection
*spu_elf_check_vma (struct bfd_link_info
*);