Back to index

cell-binutils  2.17cvs20070401
mach-o-target.c
Go to the documentation of this file.
00001 /* Mach-O support for BFD.
00002    Copyright 1999, 2000, 2001, 2002, 2007
00003    Free Software Foundation, Inc.
00004 
00005    This file is part of BFD, the Binary File Descriptor library.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software 
00019    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 #ifndef TARGET_NAME
00022 #error TARGET_NAME must be defined
00023 #endif /* TARGET_NAME */
00024 
00025 #ifndef TARGET_STRING
00026 #error TARGET_STRING must be defined
00027 #endif /* TARGET_STRING */
00028 
00029 #ifndef TARGET_BIG_ENDIAN
00030 #error TARGET_BIG_ENDIAN must be defined
00031 #endif /* TARGET_BIG_ENDIAN */
00032 
00033 #ifndef TARGET_ARCHIVE
00034 #error TARGET_ARCHIVE must be defined
00035 #endif /* TARGET_ARCHIVE */
00036 
00037 #if ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN))
00038 #error Mach-O fat files must always be big-endian.
00039 #endif /* ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN)) */
00040 
00041 const bfd_target TARGET_NAME =
00042 {
00043   TARGET_STRING,            /* Name.  */
00044   bfd_target_mach_o_flavour,
00045 #if TARGET_BIG_ENDIAN
00046   BFD_ENDIAN_BIG,           /* Target byte order.  */
00047   BFD_ENDIAN_BIG,           /* Target headers byte order.  */
00048 #else
00049   BFD_ENDIAN_LITTLE,        /* Target byte order.  */
00050   BFD_ENDIAN_LITTLE,        /* Target headers byte order.  */
00051 #endif
00052   (HAS_RELOC | EXEC_P |            /* Object flags.  */
00053    HAS_LINENO | HAS_DEBUG |
00054    HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
00055   (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
00056    | SEC_ALLOC | SEC_LOAD | SEC_RELOC),   /* Section flags.  */
00057   '_',                      /* symbol_leading_char.  */
00058   ' ',                      /* ar_pad_char.  */
00059   16,                       /* ar_max_namelen.  */
00060 
00061 #if TARGET_BIG_ENDIAN
00062   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00063   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00064   bfd_getb16, bfd_getb_signed_16, bfd_putb16,    /* Data.  */
00065   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00066   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00067   bfd_getb16, bfd_getb_signed_16, bfd_putb16,    /* Hdrs.  */
00068 #else
00069   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
00070   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
00071   bfd_getl16, bfd_getl_signed_16, bfd_putl16,    /* data */
00072   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
00073   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
00074   bfd_getl16, bfd_getl_signed_16, bfd_putl16,    /* hdrs */
00075 #endif /* TARGET_BIG_ENDIAN */
00076 
00077   {                         /* bfd_check_format.  */
00078 #if TARGET_ARCHIVE
00079     _bfd_dummy_target,
00080     _bfd_dummy_target,
00081     bfd_mach_o_archive_p,
00082     _bfd_dummy_target,
00083 #else
00084     _bfd_dummy_target,
00085     bfd_mach_o_object_p,
00086     _bfd_dummy_target,
00087     bfd_mach_o_core_p
00088 #endif
00089   },
00090   {                         /* bfd_set_format.  */
00091     bfd_false,
00092     bfd_mach_o_mkobject,
00093     bfd_false,
00094     bfd_mach_o_mkobject,
00095   },
00096   {                         /* bfd_write_contents.  */
00097     bfd_false,
00098     bfd_mach_o_write_contents,
00099     bfd_false,
00100     bfd_mach_o_write_contents,
00101   },
00102 
00103   BFD_JUMP_TABLE_GENERIC (bfd_mach_o),
00104   BFD_JUMP_TABLE_COPY (bfd_mach_o),
00105   BFD_JUMP_TABLE_CORE (bfd_mach_o),
00106   BFD_JUMP_TABLE_ARCHIVE (bfd_mach_o),
00107   BFD_JUMP_TABLE_SYMBOLS (bfd_mach_o),
00108   BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
00109   BFD_JUMP_TABLE_WRITE (bfd_mach_o),
00110   BFD_JUMP_TABLE_LINK (bfd_mach_o),
00111   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
00112 
00113   NULL,
00114 
00115   NULL
00116 };
00117