aboutsummaryrefslogtreecommitdiff
path: root/bfd/libaout.h
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-10-05 05:18:08 +0000
committerJohn Gilmore <gnu@cygnus>1991-10-05 05:18:08 +0000
commit9e2dad8ed4b31d55281cca6915da87d2ea487125 (patch)
tree11f55d72a3ea4588a6ae85d86824c7543aef9814 /bfd/libaout.h
parent5784123fb7a17931182241875d6affa7d3900727 (diff)
downloadgdb-9e2dad8ed4b31d55281cca6915da87d2ea487125.zip
gdb-9e2dad8ed4b31d55281cca6915da87d2ea487125.tar.gz
gdb-9e2dad8ed4b31d55281cca6915da87d2ea487125.tar.bz2
* bfd.c: Remove strerror() to libiberty.
* elf.c: Remove elf_set_section_contents, use generic one. Lint. * libbfd-in.h, libbfd.c: Add bfd_generic_set_section_contents. * libbfd.c (bfd_generic_{get,set}_section_contents): Check that last byte of transfer, not first byte, is within the section. * host-aout.c: Remove `BSD' archive support. Lint. * archures.c: Rename `struct bfd_arch_info_struct' to `struct bfd_arch_info'. Rename `typedef bfd_arch_info_struct_type' to `bfd_arch_info_type'. All uses changed. * reloc.c: Rename `bfd_reloc_status_enum_type' to `bfd_reloc_status_type'. Rename `bfd_reloc_code_enum_real_type' to `bfd_reloc_code_real_type'. (This seems to be a misnomer, it needs a better name.) All uses changed. * targets.c: Rename `enum target_flavour_enum' to `enum target_flavour', and remove the `_enum' from all of the enum values themselves. All uses changed. * configure.in, config/h-i386mach: i386 mach host. * config/t-i386-aout: Use host-aout.c. * trad-core.c: Give it its own xvec's to make it independent of other file formats. * ecoff.c, host-aout.c: Remove refs to trad-core. * config/t-dec3100, t-hp300bsd, t-tahoe, t-vax: Define TRAD_CORE. * targets.c: #ifdef TRAD_CORE, include it in the vector.
Diffstat (limited to 'bfd/libaout.h')
-rw-r--r--bfd/libaout.h49
1 files changed, 29 insertions, 20 deletions
diff --git a/bfd/libaout.h b/bfd/libaout.h
index c3b55ac..269dd41 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -1,26 +1,26 @@
/* BFD back-end data structures for a.out (and similar) files.
+ Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Written by Cygnus Support.
- We try to encapsulate the differences in a few routines, and otherwise
- share large masses of code. This means we only have to fix bugs in
- one place, most of the time. */
+This file is part of BFD, the Binary File Descriptor library.
-/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Diddler.
-
-BFD is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-BFD is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with BFD; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* We try to encapsulate the differences in the various a.out file
+ variants in a few routines, and otherwise share large masses of code.
+ This means we only have to fix bugs in one place, most of the time. */
/* $Id$ */
@@ -30,7 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define CAT3(a,b,c) a/**/b/**/c
#endif
-
/* Parameterize the a.out code based on whether it is being built
for a 32-bit architecture or a 64-bit architecture. */
#if ARCH_SIZE==64
@@ -59,6 +58,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define obj_reloc_entry_size(bfd) (adata(bfd)->reloc_entry_size)
+/* Declare these types at file level, since they are used in parameter
+ lists, which have wierd scope. */
+struct external_exec;
+struct internal_exec;
+
typedef struct aout_symbol {
asymbol symbol;
short desc;
@@ -129,7 +133,7 @@ PROTO (unsigned int, NAME(aout,get_reloc_upper_bound), (bfd *abfd, sec_ptr asect
PROTO (void, NAME(aout,reclaim_reloc), (bfd *ignore_abfd, sec_ptr ignore));
PROTO (alent *, NAME(aout,get_lineno), (bfd *ignore_abfd, asymbol *ignore_symbol));
PROTO (void, NAME(aout,print_symbol), (bfd *ignore_abfd, PTR file,
- asymbol *symbol, bfd_print_symbol_enum_type how));
+ asymbol *symbol, bfd_print_symbol_type how));
PROTO (boolean, NAME(aout,close_and_cleanup), (bfd *abfd));
PROTO (boolean, NAME(aout,find_nearest_line), (bfd *abfd, asection *section,
asymbol **symbols, bfd_vma offset, CONST char **filename_ptr,
@@ -172,18 +176,23 @@ PROTO (void, NAME(aout,swap_exec_header_out),(bfd *abfd, struct internal_exec *e
#define WRITE_HEADERS(abfd, execp) \
{ \
+ if ((obj_textsec(abfd)->vma & 0xff )== EXEC_BYTES_SIZE) \
+ abfd->flags |= D_PAGED; \
+ else \
+ abfd->flags &= ~D_PAGED; \
if (abfd->flags & D_PAGED) \
{ \
execp->a_text = obj_textsec (abfd)->size + EXEC_BYTES_SIZE; \
N_SET_MAGIC (*execp, ZMAGIC); \
} \
- else if (abfd->flags & WP_TEXT) \
+ else \
{ \
- N_SET_MAGIC (*execp, NMAGIC); \
+ execp->a_text = obj_textsec (abfd)->size; \
+ if (abfd->flags & WP_TEXT) \
+ { N_SET_MAGIC (*execp, NMAGIC); } \
+ else \
+ { N_SET_MAGIC(*execp, OMAGIC); } \
} \
- else { \
- N_SET_MAGIC(*execp, OMAGIC); \
- } \
if (abfd->flags & D_PAGED) \
{ \
data_pad = ((obj_datasec(abfd)->size + PAGE_SIZE -1) \