host-aout.c revision 302408
137Srgrimes/* BFD backend for local host's a.out binaries 237Srgrimes Copyright 1990, 1991, 1992, 1994, 1995, 2001, 2007 3358Srgrimes Free Software Foundation, Inc. 437Srgrimes Written by Cygnus Support. Probably John Gilmore's fault. 537Srgrimes 637SrgrimesThis file is part of BFD, the Binary File Descriptor library. 7147Srgrimes 8147SrgrimesThis program is free software; you can redistribute it and/or modify 9147Srgrimesit under the terms of the GNU General Public License as published by 10207Snatethe Free Software Foundation; either version 2 of the License, or 11377Srgrimes(at your option) any later version. 12147Srgrimes 13147SrgrimesThis program is distributed in the hope that it will be useful, 1437Srgrimesbut WITHOUT ANY WARRANTY; without even the implied warranty of 1537SrgrimesMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1637SrgrimesGNU General Public License for more details. 1737Srgrimes 18147SrgrimesYou should have received a copy of the GNU General Public License 19147Srgrimesalong with this program; if not, write to the Free Software 20147SrgrimesFoundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 21491Srgrimes 2237Srgrimes#include "sysdep.h" 2337Srgrimes#include "bfd.h" 2437Srgrimes#include "libbfd.h" 2537Srgrimes 2637Srgrimes#define ARCH_SIZE 32 27263Srgrimes 28993Srgrimes/* When porting to a new system, you must supply: 29993Srgrimes 30993Srgrimes HOST_PAGE_SIZE (optional) 31993Srgrimes HOST_SEGMENT_SIZE (optional -- defaults to page size) 32277Srgrimes HOST_MACHINE_ARCH (optional) 33277Srgrimes HOST_MACHINE_MACHINE (optional) 34284Srgrimes HOST_TEXT_START_ADDR (optional) 35463Srgrimes HOST_STACK_END_ADDR (not used, except by trad-core ???) 36568Srgrimes HOST_BIG_ENDIAN_P (required -- define if big-endian) 37284Srgrimes 38284Srgrimes in the ./hosts/h-systemname.h file. */ 39284Srgrimes 40284Srgrimes#ifdef TRAD_HEADER 41284Srgrimes#include TRAD_HEADER 42284Srgrimes#endif 43284Srgrimes 44284Srgrimes#ifdef HOST_PAGE_SIZE 45284Srgrimes#define TARGET_PAGE_SIZE HOST_PAGE_SIZE 46284Srgrimes#endif 47358Srgrimes 48358Srgrimes#ifdef HOST_SEGMENT_SIZE 49358Srgrimes#define SEGMENT_SIZE HOST_SEGMENT_SIZE 50452Srgrimes#else 51358Srgrimes#define SEGMENT_SIZE TARGET_PAGE_SIZE 52412Salm#endif 53358Srgrimes 54452Srgrimes#ifdef HOST_TEXT_START_ADDR 55358Srgrimes#define TEXT_START_ADDR HOST_TEXT_START_ADDR 56452Srgrimes#endif 57358Srgrimes 58358Srgrimes#ifdef HOST_STACK_END_ADDR 59412Salm#define STACK_END_ADDR HOST_STACK_END_ADDR 60358Srgrimes#endif 61358Srgrimes 62358Srgrimes#ifdef HOST_BIG_ENDIAN_P 63263Srgrimes#define TARGET_IS_BIG_ENDIAN_P 64358Srgrimes#else 65358Srgrimes#undef TARGET_IS_BIG_ENDIAN_P 66452Srgrimes#endif 67481Salm 68452Srgrimes#include "libaout.h" /* BFD a.out internal data structures */ 69452Srgrimes#include "aout/aout64.h" 70358Srgrimes 71358Srgrimes#ifdef HOST_MACHINE_ARCH 72358Srgrimes#ifdef HOST_MACHINE_MACHINE 73358Srgrimes#define SET_ARCH_MACH(abfd, execp) \ 74813Srgrimes bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, HOST_MACHINE_MACHINE) 75284Srgrimes#else 76347Srgrimes#define SET_ARCH_MACH(abfd, execp) \ 77372Srgrimes bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, 0) 78372Srgrimes#endif 79372Srgrimes#endif /* HOST_MACHINE_ARCH */ 80372Srgrimes 81372Srgrimes/* Do not "beautify" the CONCAT* macro args. Traditional C will not 82372Srgrimes remove whitespace added here, and thus will fail to concatenate 83347Srgrimes the tokens. */ 8437Srgrimes#define MY(OP) CONCAT2 (host_aout_,OP) 8537Srgrimes#define TARGETNAME "a.out" 86347Srgrimes 87347Srgrimes#include "aout-target.h" 88347Srgrimes