Back to index

cell-binutils  2.17cvs20070401
elfxx-sparc.h
Go to the documentation of this file.
00001 /* SPARC ELF specific backend routines.
00002    Copyright 2005, 2007 Free Software Foundation, Inc.
00003 
00004 This file is part of BFD, the Binary File Descriptor library.
00005 
00006 This program is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 #include "elf/common.h"
00021 #include "elf/internal.h"
00022 
00023 struct _bfd_sparc_elf_section_data
00024 {
00025   struct bfd_elf_section_data elf;
00026   unsigned int do_relax, reloc_count;
00027 };
00028 
00029 #define sec_do_relax(sec) \
00030   ((struct _bfd_sparc_elf_section_data *) elf_section_data (sec))->do_relax
00031 #define canon_reloc_count(sec) \
00032   ((struct _bfd_sparc_elf_section_data *) elf_section_data (sec))->reloc_count
00033 
00034 struct _bfd_sparc_elf_app_reg
00035 {
00036   unsigned char bind;
00037   unsigned short shndx;
00038   bfd *abfd;
00039   char *name;
00040 };
00041 
00042 /* Sparc ELF linker hash table.  */
00043 
00044 struct _bfd_sparc_elf_link_hash_table
00045 {
00046   struct elf_link_hash_table elf;
00047 
00048   /* Short-cuts to get to dynamic linker sections.  */
00049   asection *sgot;
00050   asection *srelgot;
00051   asection *splt;
00052   asection *srelplt;
00053   asection *sdynbss;
00054   asection *srelbss;
00055 
00056   union {
00057     bfd_signed_vma refcount;
00058     bfd_vma offset;
00059   } tls_ldm_got;
00060 
00061   /* Small local sym to section mapping cache.  */
00062   struct sym_sec_cache sym_sec;
00063 
00064   /* True if the target system is VxWorks.  */
00065   int is_vxworks;
00066 
00067   /* The (unloaded but important) .rela.plt.unloaded section, for VxWorks.  */
00068   asection *srelplt2;
00069 
00070   /* .got.plt is only used on VxWorks.  */
00071   asection *sgotplt;
00072 
00073   void (*put_word) (bfd *, bfd_vma, void *);
00074   bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma);
00075   bfd_vma (*r_symndx) (bfd_vma);
00076   int (*build_plt_entry) (bfd *, asection *, bfd_vma, bfd_vma, bfd_vma *);
00077   const char *dynamic_interpreter;
00078   int dynamic_interpreter_size;
00079   unsigned int word_align_power;
00080   unsigned int align_power_max;
00081   unsigned int plt_header_size;
00082   unsigned int plt_entry_size;
00083   int bytes_per_word;
00084   int bytes_per_rela;
00085   int dtpoff_reloc;
00086   int dtpmod_reloc;
00087   int tpoff_reloc;
00088 
00089   struct _bfd_sparc_elf_app_reg app_regs [4];
00090 };
00091 
00092 /* Get the SPARC ELF linker hash table from a link_info structure.  */
00093 
00094 #define _bfd_sparc_elf_hash_table(p) \
00095   ((struct _bfd_sparc_elf_link_hash_table *) ((p)->hash))
00096 
00097 extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup
00098   (bfd *, bfd_reloc_code_real_type);
00099 extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup
00100   (bfd *, const char *);
00101 extern void _bfd_sparc_elf_info_to_howto
00102   (bfd *, arelent *, Elf_Internal_Rela *);
00103 extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr
00104   (unsigned int);
00105 extern bfd_boolean _bfd_sparc_elf_mkobject
00106   (bfd *);
00107 extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create
00108   (bfd *);
00109 extern bfd_boolean _bfd_sparc_elf_create_dynamic_sections
00110   (bfd *, struct bfd_link_info *);
00111 extern void _bfd_sparc_elf_copy_indirect_symbol
00112   (struct bfd_link_info *,
00113    struct elf_link_hash_entry *,
00114    struct elf_link_hash_entry *);
00115 extern bfd_boolean _bfd_sparc_elf_check_relocs
00116   (bfd *, struct bfd_link_info *,
00117    asection *, const Elf_Internal_Rela *);
00118 extern asection *_bfd_sparc_elf_gc_mark_hook
00119   (asection *, struct bfd_link_info *,
00120    Elf_Internal_Rela *, struct elf_link_hash_entry *,
00121    Elf_Internal_Sym *);
00122 extern bfd_boolean _bfd_sparc_elf_gc_sweep_hook
00123   (bfd *, struct bfd_link_info *,
00124    asection *, const Elf_Internal_Rela *);
00125 extern bfd_boolean _bfd_sparc_elf_adjust_dynamic_symbol
00126   (struct bfd_link_info *, struct elf_link_hash_entry *);
00127 extern bfd_boolean _bfd_sparc_elf_omit_section_dynsym
00128   (bfd *, struct bfd_link_info *, asection *);
00129 extern bfd_boolean _bfd_sparc_elf_size_dynamic_sections
00130   (bfd *, struct bfd_link_info *);
00131 extern bfd_boolean _bfd_sparc_elf_new_section_hook
00132   (bfd *, asection *);
00133 extern bfd_boolean _bfd_sparc_elf_relax_section
00134   (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
00135 extern bfd_boolean _bfd_sparc_elf_relocate_section
00136   (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
00137    Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
00138 extern bfd_boolean _bfd_sparc_elf_finish_dynamic_symbol
00139   (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
00140    Elf_Internal_Sym *sym);
00141 extern bfd_boolean _bfd_sparc_elf_finish_dynamic_sections
00142   (bfd *, struct bfd_link_info *);
00143 extern bfd_boolean _bfd_sparc_elf_object_p
00144   (bfd *);
00145 extern bfd_vma _bfd_sparc_elf_plt_sym_val
00146   (bfd_vma, const asection *, const arelent *);