Support for building as a shared library, based on patches from
[deliverable/binutils-gdb.git] / bfd / host-aout.c
CommitLineData
fb3be09b
JG
1/* BFD backend for local host's a.out binaries
2 Copyright (C) 1990-1991 Free Software Foundation, Inc.
3 Written by Cygnus Support. Probably John Gilmore's fault.
c4cd3fc6 4
fb3be09b 5This file is part of BFD, the Binary File Descriptor library.
c4cd3fc6 6
fb3be09b 7This program is free software; you can redistribute it and/or modify
c4cd3fc6 8it under the terms of the GNU General Public License as published by
fb3be09b
JG
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
c4cd3fc6 11
fb3be09b 12This program is distributed in the hope that it will be useful,
c4cd3fc6
JG
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
fb3be09b
JG
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
c4cd3fc6 20
c4cd3fc6 21#include "bfd.h"
bbc8d484 22#include "sysdep.h"
c4cd3fc6
JG
23#include "libbfd.h"
24
fa8c88b2 25#define ARCH_SIZE 32
fb3be09b 26
fa8c88b2 27/* When porting to a new system, you must supply:
fb3be09b 28
fa8c88b2
SG
29 HOST_PAGE_SIZE (optional)
30 HOST_SEGMENT_SIZE (optional -- defaults to page size)
fb3be09b
JG
31 HOST_MACHINE_ARCH (optional)
32 HOST_MACHINE_MACHINE (optional)
fa8c88b2
SG
33 HOST_TEXT_START_ADDR (optional)
34 HOST_STACK_END_ADDR (not used, except by trad-core ???)
35 HOST_SHORT_HEADER_HACK (optional)
fb3be09b 36
fa8c88b2 37 in the ./hosts/h-systemname.h file.
fb3be09b 38
fa8c88b2
SG
39 For most of these, you can get by with the values computed
40 by the program aout-gen, which writes the result into aout-params.h. */
fb3be09b 41
fa8c88b2 42#include "aout-params.h"
fb3be09b 43
fa8c88b2
SG
44#ifdef HOST_PAGE_SIZE
45#define PAGE_SIZE HOST_PAGE_SIZE
fb3be09b 46#endif
fa8c88b2
SG
47#ifdef HOST_SEGMENT_SIZE
48#define SEGMENT_SIZE HOST_SEGMENT_SIZE
49#else
50#define SEGMENT_SIZE PAGE_SIZE
fb3be09b 51#endif
fa8c88b2
SG
52#ifdef HOST_TEXT_START_ADDR
53#define TEXT_START_ADDR HOST_TEXT_START_ADDR
fb3be09b 54#endif
fa8c88b2
SG
55#ifdef HOST_STACK_END_ADDR
56#define STACK_END_ADDR HOST_STACK_END_ADDR
fb3be09b 57#endif
fa8c88b2
SG
58#ifndef N_HEADER_IN_TEXT
59#ifdef HOST_SHORT_HEADER_HACK
60#define N_HEADER_IN_TEXT(x) 1
61#else
62#define N_HEADER_IN_TEXT(x) 0
fb3be09b 63#endif
fb3be09b
JG
64#endif
65
fa8c88b2
SG
66#include "libaout.h" /* BFD a.out internal data structures */
67#include "aout/aout64.h"
c4cd3fc6
JG
68
69#ifdef HOST_MACHINE_ARCH
c4cd3fc6 70#ifdef HOST_MACHINE_MACHINE
fa8c88b2
SG
71#define SET_ARCH_MACH(abfd, execp) \
72 bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, HOST_MACHINE_MACHINE)
73#else
74#define SET_ARCH_MACH(abfd, execp) \
75 bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, 0)
76#endif
bbc8d484 77#endif /* HOST_MACHINE_ARCH */
c4cd3fc6 78
fa8c88b2
SG
79#define MY(OP) CAT(host_aout_,OP)
80#define TARGETNAME "a.out"
c4cd3fc6 81
fa8c88b2 82#include "aout-target.h"
This page took 0.162162 seconds and 4 git commands to generate.