Back to index

cell-binutils  2.17cvs20070401
host-aout.c
Go to the documentation of this file.
00001 /* BFD backend for local host's a.out binaries
00002    Copyright 1990, 1991, 1992, 1994, 1995, 2001
00003    Free Software Foundation, Inc.
00004    Written by Cygnus Support.  Probably John Gilmore's fault.
00005 
00006 This file is part of BFD, the Binary File Descriptor library.
00007 
00008 This program is free software; you can redistribute it and/or modify
00009 it under the terms of the GNU General Public License as published by
00010 the Free Software Foundation; either version 2 of the License, or
00011 (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00021 
00022 #include "bfd.h"
00023 #include "sysdep.h"
00024 #include "libbfd.h"
00025 
00026 #define       ARCH_SIZE     32
00027 
00028 /* When porting to a new system, you must supply:
00029 
00030        HOST_PAGE_SIZE              (optional)
00031        HOST_SEGMENT_SIZE    (optional -- defaults to page size)
00032        HOST_MACHINE_ARCH    (optional)
00033        HOST_MACHINE_MACHINE (optional)
00034        HOST_TEXT_START_ADDR (optional)
00035        HOST_STACK_END_ADDR  (not used, except by trad-core ???)
00036        HOST_BIG_ENDIAN_P    (required -- define if big-endian)
00037 
00038    in the ./hosts/h-systemname.h file.  */
00039 
00040 #ifdef TRAD_HEADER
00041 #include TRAD_HEADER
00042 #endif
00043 
00044 #ifdef               HOST_PAGE_SIZE
00045 #define       TARGET_PAGE_SIZE     HOST_PAGE_SIZE
00046 #endif
00047 
00048 #ifdef               HOST_SEGMENT_SIZE
00049 #define       SEGMENT_SIZE  HOST_SEGMENT_SIZE
00050 #else
00051 #define       SEGMENT_SIZE  TARGET_PAGE_SIZE
00052 #endif
00053 
00054 #ifdef               HOST_TEXT_START_ADDR
00055 #define       TEXT_START_ADDR      HOST_TEXT_START_ADDR
00056 #endif
00057 
00058 #ifdef               HOST_STACK_END_ADDR
00059 #define       STACK_END_ADDR       HOST_STACK_END_ADDR
00060 #endif
00061 
00062 #ifdef               HOST_BIG_ENDIAN_P
00063 #define       TARGET_IS_BIG_ENDIAN_P
00064 #else
00065 #undef  TARGET_IS_BIG_ENDIAN_P
00066 #endif
00067 
00068 #include "libaout.h"           /* BFD a.out internal data structures */
00069 #include "aout/aout64.h"
00070 
00071 #ifdef HOST_MACHINE_ARCH
00072 #ifdef HOST_MACHINE_MACHINE
00073 #define SET_ARCH_MACH(abfd, execp) \
00074   bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, HOST_MACHINE_MACHINE)
00075 #else
00076 #define SET_ARCH_MACH(abfd, execp) \
00077   bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, 0)
00078 #endif
00079 #endif /* HOST_MACHINE_ARCH */
00080 
00081 /* Do not "beautify" the CONCAT* macro args.  Traditional C will not
00082    remove whitespace added here, and thus will fail to concatenate
00083    the tokens.  */
00084 #define MY(OP) CONCAT2 (host_aout_,OP)
00085 #define TARGETNAME "a.out"
00086 
00087 #include "aout-target.h"