* Makefile.in: Rename XDEPFILES.
* trad-core.c: Document how to use it nowadays. * i386aout.c, newsos3.c: Clean up. * i386coff.c: Allow 386 coff files to be used as core files too (for reading core files from embedded systems).
This commit is contained in:
parent
074274252f
commit
6a46902732
|
@ -1,3 +1,21 @@
|
||||||
|
Thu Oct 10 17:54:08 1991 John Gilmore (gnu at cygnus.com)
|
||||||
|
|
||||||
|
* config/*: trad-core support is HOST dependent, not target
|
||||||
|
dependent. Target config files only set DEFAULT_VECTOR and/or
|
||||||
|
other vector elements. Exception: when host-aout.c is in use,
|
||||||
|
in which case we're forced to assume we're native (hp, vax,
|
||||||
|
tahoe). Rename XDEPFILES to HDEPFILES.
|
||||||
|
* Makefile.in: Rename XDEPFILES.
|
||||||
|
* config/h-sun*: Don't force static linking.
|
||||||
|
* trad-core.c: Document how to use it nowadays.
|
||||||
|
* i386aout.c, newsos3.c: Clean up.
|
||||||
|
* i386coff.c: Allow 386 coff files to be used as core files too
|
||||||
|
(for reading core files from embedded systems).
|
||||||
|
|
||||||
|
Tue Oct 8 15:30:39 1991 John Gilmore (gnu at cygnus.com)
|
||||||
|
|
||||||
|
* Add i386aout.c for a.out support on the i386.
|
||||||
|
|
||||||
Tue Oct 8 12:18:54 1991 Roland H. Pesch (pesch at cygnus.com)
|
Tue Oct 8 12:18:54 1991 Roland H. Pesch (pesch at cygnus.com)
|
||||||
|
|
||||||
* reloc.c, section.c, syms.c, targets.c: correct info-node
|
* reloc.c, section.c, syms.c, targets.c: correct info-node
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
srcdir = .
|
srcdir = .
|
||||||
destdir = /usr/local
|
destdir = /usr/local
|
||||||
libdir = $(destdir)/lib
|
libdir = $(destdir)/H-$(host_alias)/T-independent/lib
|
||||||
docdir = $(srcdir)/doc
|
docdir = $(srcdir)/doc
|
||||||
|
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
|
@ -69,8 +69,8 @@ STAGESTUFF = $(TARGETLIB) $(OFILES)
|
||||||
|
|
||||||
all: $(TARGETLIB)
|
all: $(TARGETLIB)
|
||||||
|
|
||||||
# XDEPFILES comes from the host config; TDEPFILES from the target config.
|
# HDEPFILES comes from the host config; TDEPFILES from the target config.
|
||||||
OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(XDEPFILES) $(TDEPFILES)
|
OFILES = $(BFD_LIBS) $(BFD_BACKENDS) $(BFD_MACHINES) $(HDEPFILES) $(TDEPFILES)
|
||||||
|
|
||||||
$(TARGETLIB): $(OFILES)
|
$(TARGETLIB): $(OFILES)
|
||||||
rm -f $(TARGETLIB)
|
rm -f $(TARGETLIB)
|
||||||
|
@ -166,8 +166,9 @@ roll:
|
||||||
force:
|
force:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -c libbfd.a $(libdir)
|
cp libbfd.a $(libdir)/libbfd.a.new
|
||||||
$(RANLIB) $(libdir)/libbfd.a
|
$(RANLIB) $(libdir)/libbfd.a.new
|
||||||
|
mv -f $(libdir)/libbfd.a.new $(libdir)/libbfd.a
|
||||||
|
|
||||||
# Target to uncomment host-specific lines in this makefile. Such lines must
|
# Target to uncomment host-specific lines in this makefile. Such lines must
|
||||||
# have the following string beginning in column 1: #__<hostname>__#
|
# have the following string beginning in column 1: #__<hostname>__#
|
||||||
|
|
|
@ -1,21 +1,22 @@
|
||||||
/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
|
/* BFD back-end for Intel 386 COFF files.
|
||||||
|
Copyright (C) 1990-1991 Free Software Foundation, Inc.
|
||||||
|
Written by Cygnus Support.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Diddler.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
|
|
||||||
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 1, or (at your option)
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with BFD; see the file COPYING. If not, write to
|
along with this program; if not, write to the Free Software
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
#include "libbfd.h"
|
#include "libbfd.h"
|
||||||
#include "obstack.h"
|
#include "obstack.h"
|
||||||
#include "i386coff.h"
|
#include "i386coff.h"
|
||||||
|
#include "internalcoff.h"
|
||||||
#include "libcoff.h"
|
#include "libcoff.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,14 +56,12 @@ static reloc_howto_type howto_table[] =
|
||||||
HOWTO(R_PCRLONG, 0, 2, 32, true, 0, false, true,0,"DISP32", true, 0xffffffff,0xffffffff, false),
|
HOWTO(R_PCRLONG, 0, 2, 32, true, 0, false, true,0,"DISP32", true, 0xffffffff,0xffffffff, false),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Turn a howto into a reloc nunmber */
|
/* Turn a howto into a reloc nunmber */
|
||||||
|
|
||||||
#define SELECT_RELOC(x,howto) { x = howto->type; }
|
#define SELECT_RELOC(x,howto) { x = howto->type; }
|
||||||
#define BADMAG(x) I386BADMAG(x)
|
#define BADMAG(x) I386BADMAG(x)
|
||||||
#include "coffcode.h"
|
#include "coffcode.h"
|
||||||
|
|
||||||
|
|
||||||
#define coff_write_armap bsd_write_armap
|
#define coff_write_armap bsd_write_armap
|
||||||
|
|
||||||
bfd_target *i3coff_object_p(a)
|
bfd_target *i3coff_object_p(a)
|
||||||
|
@ -70,10 +70,10 @@ bfd *a ;
|
||||||
|
|
||||||
bfd_target i386coff_vec =
|
bfd_target i386coff_vec =
|
||||||
{
|
{
|
||||||
"i386coff", /* name */
|
"i386coff", /* name */
|
||||||
bfd_target_coff_flavour_enum,
|
bfd_target_coff_flavour,
|
||||||
false, /* data byte order is big */
|
false, /* data byte order is little */
|
||||||
false, /* header byte order is big */
|
false, /* header byte order is little */
|
||||||
|
|
||||||
(HAS_RELOC | EXEC_P | /* object flags */
|
(HAS_RELOC | EXEC_P | /* object flags */
|
||||||
HAS_LINENO | HAS_DEBUG |
|
HAS_LINENO | HAS_DEBUG |
|
||||||
|
@ -83,20 +83,18 @@ bfd_target i386coff_vec =
|
||||||
'/', /* ar_pad_char */
|
'/', /* ar_pad_char */
|
||||||
15, /* ar_max_namelen */
|
15, /* ar_max_namelen */
|
||||||
|
|
||||||
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */
|
2, /* minimum alignment power */
|
||||||
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */
|
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */
|
||||||
|
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */
|
||||||
|
|
||||||
{_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */
|
/* Note that we allow an object file to be treated as a core file as well. */
|
||||||
bfd_generic_archive_p, _bfd_dummy_target},
|
{_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */
|
||||||
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
|
bfd_generic_archive_p, i3coff_object_p},
|
||||||
bfd_false},
|
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
|
||||||
{bfd_false, coff_write_object_contents, /* bfd_write_contents */
|
bfd_false},
|
||||||
_bfd_write_archive_contents, bfd_false},
|
{bfd_false, coff_write_object_contents, /* bfd_write_contents */
|
||||||
|
_bfd_write_archive_contents, bfd_false},
|
||||||
JUMP_TABLE(coff),
|
|
||||||
COFF_SWAP_TABLE
|
|
||||||
|
|
||||||
|
JUMP_TABLE(coff),
|
||||||
|
COFF_SWAP_TABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,158 @@
|
||||||
|
/* BFD back-end for i386 a.out binaries.
|
||||||
|
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
|
|
||||||
|
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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
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 this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#define PAGE_SIZE 4096
|
||||||
|
#define SEGMENT_SIZE PAGE_SIZE
|
||||||
|
#define TEXT_START_ADDR 0x8000
|
||||||
|
#define ARCH 32
|
||||||
|
#define BYTES_IN_WORD 4
|
||||||
|
|
||||||
|
#include <ansidecl.h>
|
||||||
|
#include <sysdep.h>
|
||||||
|
#include "bfd.h"
|
||||||
|
#include "libbfd.h"
|
||||||
|
#include "aout64.h"
|
||||||
|
|
||||||
|
/**From: bothner@cs.wisc.edu***********************************************/
|
||||||
|
#undef N_TXTOFF
|
||||||
|
#define N_TXTOFF(x) ( (N_MAGIC((x)) == ZMAGIC) ? PAGE_SIZE : EXEC_BYTES_SIZE)
|
||||||
|
/**************************************************************************/
|
||||||
|
|
||||||
|
#include "stab.gnu.h"
|
||||||
|
#include "ar.h"
|
||||||
|
#include "libaout.h" /* BFD a.out internal data structures */
|
||||||
|
|
||||||
|
bfd_target *aout386_callback ();
|
||||||
|
|
||||||
|
bfd_target *
|
||||||
|
DEFUN(aout386_object_p,(abfd),
|
||||||
|
bfd *abfd)
|
||||||
|
{
|
||||||
|
struct external_exec exec_bytes;
|
||||||
|
struct internal_exec exec;
|
||||||
|
|
||||||
|
if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
|
||||||
|
!= EXEC_BYTES_SIZE) {
|
||||||
|
bfd_error = wrong_format;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
|
||||||
|
|
||||||
|
if (N_BADMAG (exec)) return 0;
|
||||||
|
|
||||||
|
NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
|
||||||
|
return aout_32_some_aout_object_p (abfd, &exec, aout386_callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Finish up the reading of the file header */
|
||||||
|
bfd_target *
|
||||||
|
DEFUN(aout386_callback,(abfd),
|
||||||
|
bfd *abfd)
|
||||||
|
{
|
||||||
|
struct internal_exec *execp = exec_hdr (abfd);
|
||||||
|
|
||||||
|
WORK_OUT_FILE_POSITIONS(abfd, execp) ;
|
||||||
|
|
||||||
|
/* Determine the architecture and machine type of the object file. */
|
||||||
|
bfd_default_set_arch_mach(abfd, bfd_arch_i386, 0);
|
||||||
|
|
||||||
|
return abfd->xvec;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Write an object file.
|
||||||
|
Section contents have already been written. We write the
|
||||||
|
file header, symbols, and relocation. */
|
||||||
|
|
||||||
|
boolean
|
||||||
|
DEFUN(aout386_write_object_contents,(abfd),
|
||||||
|
bfd *abfd)
|
||||||
|
{
|
||||||
|
bfd_size_type data_pad = 0;
|
||||||
|
struct external_exec exec_bytes;
|
||||||
|
struct internal_exec *execp = exec_hdr (abfd);
|
||||||
|
|
||||||
|
WRITE_HEADERS(abfd, execp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transfer vector */
|
||||||
|
|
||||||
|
/* We use BSD archive files. */
|
||||||
|
#define aout386_openr_next_archived_file bfd_generic_openr_next_archived_file
|
||||||
|
#define aout386_generic_stat_arch_elt bfd_generic_stat_arch_elt
|
||||||
|
#define aout386_slurp_armap bfd_slurp_bsd_armap
|
||||||
|
#define aout386_slurp_extended_name_table bfd_true
|
||||||
|
#define aout386_write_armap bsd_write_armap
|
||||||
|
#define aout386_truncate_arname bfd_bsd_truncate_arname
|
||||||
|
|
||||||
|
/* We don't support core files here. */
|
||||||
|
#define aout386_core_file_failing_command _bfd_dummy_core_file_failing_command
|
||||||
|
#define aout386_core_file_failing_signal _bfd_dummy_core_file_failing_signal
|
||||||
|
#define aout386_core_file_matches_executable_p \
|
||||||
|
_bfd_dummy_core_file_matches_executable_p
|
||||||
|
#define aout386_core_file_p _bfd_dummy_target
|
||||||
|
|
||||||
|
#define aout386_bfd_debug_info_start bfd_void
|
||||||
|
#define aout386_bfd_debug_info_end bfd_void
|
||||||
|
#define aout386_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
|
||||||
|
|
||||||
|
#define aout386_mkobject aout_32_mkobject
|
||||||
|
#define aout386_close_and_cleanup aout_32_close_and_cleanup
|
||||||
|
#define aout386_set_section_contents aout_32_set_section_contents
|
||||||
|
#define aout386_get_section_contents aout_32_get_section_contents
|
||||||
|
#define aout386_new_section_hook aout_32_new_section_hook
|
||||||
|
#define aout386_get_symtab_upper_bound aout_32_get_symtab_upper_bound
|
||||||
|
#define aout386_get_symtab aout_32_get_symtab
|
||||||
|
#define aout386_get_reloc_upper_bound aout_32_get_reloc_upper_bound
|
||||||
|
#define aout386_canonicalize_reloc aout_32_canonicalize_reloc
|
||||||
|
#define aout386_make_empty_symbol aout_32_make_empty_symbol
|
||||||
|
#define aout386_print_symbol aout_32_print_symbol
|
||||||
|
#define aout386_get_lineno aout_32_get_lineno
|
||||||
|
#define aout386_set_arch_mach aout_32_set_arch_mach
|
||||||
|
#define aout386_find_nearest_line aout_32_find_nearest_line
|
||||||
|
#define aout386_sizeof_headers aout_32_sizeof_headers
|
||||||
|
|
||||||
|
bfd_target i386aout_vec = /* Intel 386 running a.out, embedded. */
|
||||||
|
{
|
||||||
|
"a.out-i386", /* name */
|
||||||
|
bfd_target_aout_flavour,
|
||||||
|
false, /* target byte order */
|
||||||
|
false, /* target headers byte order */
|
||||||
|
(HAS_RELOC | EXEC_P | /* object flags */
|
||||||
|
HAS_LINENO | HAS_DEBUG |
|
||||||
|
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||||
|
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
|
||||||
|
' ', /* ar_pad_char */
|
||||||
|
16, /* ar_max_namelen */
|
||||||
|
1, /* minimum alignment */
|
||||||
|
/* data swap routines */
|
||||||
|
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16,
|
||||||
|
/* header swap routines */
|
||||||
|
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16,
|
||||||
|
|
||||||
|
{_bfd_dummy_target, aout386_object_p, /* bfd_check_format */
|
||||||
|
bfd_generic_archive_p, aout386_core_file_p},
|
||||||
|
{bfd_false, aout386_mkobject, /* bfd_set_format */
|
||||||
|
_bfd_generic_mkarchive, bfd_false},
|
||||||
|
{bfd_false, aout386_write_object_contents, /* bfd_write_contents */
|
||||||
|
_bfd_write_archive_contents, bfd_false},
|
||||||
|
|
||||||
|
JUMP_TABLE(aout386)
|
||||||
|
};
|
|
@ -17,8 +17,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#define TARGET_BYTE_ORDER_BIG_P 1
|
|
||||||
|
|
||||||
#define PAGE_SIZE 4096
|
#define PAGE_SIZE 4096
|
||||||
#define SEGMENT_SIZE PAGE_SIZE
|
#define SEGMENT_SIZE PAGE_SIZE
|
||||||
#define TEXT_START_ADDR 0
|
#define TEXT_START_ADDR 0
|
||||||
|
@ -54,19 +52,21 @@ bfd_target *
|
||||||
DEFUN(newsos3_object_p,(abfd),
|
DEFUN(newsos3_object_p,(abfd),
|
||||||
bfd *abfd)
|
bfd *abfd)
|
||||||
{
|
{
|
||||||
unsigned char magicbuf[4]; /* Raw bytes of magic number from file */
|
struct external_exec exec_bytes;
|
||||||
unsigned long magic; /* Swapped magic number */
|
struct internal_exec exec;
|
||||||
|
|
||||||
bfd_error = system_call_error;
|
if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
|
||||||
|
!= EXEC_BYTES_SIZE) {
|
||||||
if (bfd_read ((PTR)magicbuf, 1, sizeof (magicbuf), abfd) !=
|
bfd_error = wrong_format;
|
||||||
sizeof (magicbuf))
|
|
||||||
return 0;
|
return 0;
|
||||||
magic = bfd_h_get_32 (abfd, magicbuf);
|
}
|
||||||
|
|
||||||
if (N_BADMAG (*((struct internal_exec *) &magic))) return 0;
|
exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
|
||||||
|
|
||||||
return aout_32_some_aout_object_p (abfd, newsos3_callback);
|
if (N_BADMAG (exec)) return 0;
|
||||||
|
|
||||||
|
NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
|
||||||
|
return aout_32_some_aout_object_p (abfd, &exec, newsos3_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finish up the reading of a NEWS-OS a.out file header */
|
/* Finish up the reading of a NEWS-OS a.out file header */
|
||||||
|
|
129
bfd/trad-core.c
129
bfd/trad-core.c
|
@ -18,13 +18,18 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
/* This file does not define a particular back-end, but it defines routines
|
/* To use this file on a particular host, configure the host with these
|
||||||
that can be used by other back-ends. */
|
parameters in the config/h-HOST file:
|
||||||
|
|
||||||
|
HDEFINES=-DHOST_SYS=WHATEVER_SYS -DTRAD_CORE
|
||||||
|
HDEPFILES=trad-core.o
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "libbfd.h"
|
#include "libbfd.h"
|
||||||
|
|
||||||
#include "libaout.h" /* BFD a.out internal data structures */
|
#include "libaout.h" /* BFD a.out internal data structures */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -38,13 +43,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
/* need this cast b/c ptr is really void * */
|
|
||||||
#define core_hdr(bfd) (((struct core_data *) (bfd->tdata))->hdr)
|
|
||||||
#define core_datasec(bfd) (((struct core_data *) ((bfd)->tdata))->data_section)
|
|
||||||
#define core_stacksec(bfd) (((struct core_data*)((bfd)->tdata))->stack_section)
|
|
||||||
#define core_regsec(bfd) (((struct core_data *) ((bfd)->tdata))->reg_section)
|
|
||||||
#define core_upage(bfd) (((struct core_data *) ((bfd)->tdata))->upage)
|
|
||||||
|
|
||||||
/* These are stored in the bfd's tdata */
|
/* These are stored in the bfd's tdata */
|
||||||
struct core_data {
|
struct core_data {
|
||||||
struct user *upage; /* core file header */
|
struct user *upage; /* core file header */
|
||||||
|
@ -53,6 +51,12 @@ struct core_data {
|
||||||
asection *reg_section;
|
asection *reg_section;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define core_hdr(bfd) (((struct core_data *) (bfd->tdata))->hdr)
|
||||||
|
#define core_upage(bfd) (((struct core_data *) ((bfd)->tdata))->upage)
|
||||||
|
#define core_datasec(bfd) (((struct core_data *) ((bfd)->tdata))->data_section)
|
||||||
|
#define core_stacksec(bfd) (((struct core_data*)((bfd)->tdata))->stack_section)
|
||||||
|
#define core_regsec(bfd) (((struct core_data *) ((bfd)->tdata))->reg_section)
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
bfd_target *
|
bfd_target *
|
||||||
trad_unix_core_file_p (abfd)
|
trad_unix_core_file_p (abfd)
|
||||||
|
@ -119,9 +123,9 @@ loser2:
|
||||||
core_datasec (abfd)->name = ".data";
|
core_datasec (abfd)->name = ".data";
|
||||||
core_regsec (abfd)->name = ".reg";
|
core_regsec (abfd)->name = ".reg";
|
||||||
|
|
||||||
core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD;
|
core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
|
||||||
core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD;
|
core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
|
||||||
core_regsec (abfd)->flags = SEC_ALLOC;
|
core_regsec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
|
||||||
|
|
||||||
core_datasec (abfd)->size = NBPG * u.u_dsize;
|
core_datasec (abfd)->size = NBPG * u.u_dsize;
|
||||||
core_stacksec (abfd)->size = NBPG * u.u_ssize;
|
core_stacksec (abfd)->size = NBPG * u.u_ssize;
|
||||||
|
@ -180,3 +184,102 @@ trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd)
|
||||||
{
|
{
|
||||||
return true; /* FIXME, We have no way of telling at this point */
|
return true; /* FIXME, We have no way of telling at this point */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* No archive file support via this BFD */
|
||||||
|
#define trad_unix_openr_next_archived_file bfd_generic_openr_next_archived_file
|
||||||
|
#define trad_unix_generic_stat_arch_elt bfd_generic_stat_arch_elt
|
||||||
|
#define trad_unix_slurp_armap bfd_false
|
||||||
|
#define trad_unix_slurp_extended_name_table bfd_true
|
||||||
|
#define trad_unix_write_armap (PROTO (boolean, (*), \
|
||||||
|
(bfd *arch, unsigned int elength, struct orl *map, int orl_count, \
|
||||||
|
int stridx))) bfd_false
|
||||||
|
#define trad_unix_truncate_arname bfd_dont_truncate_arname
|
||||||
|
#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file
|
||||||
|
|
||||||
|
#define trad_unix_close_and_cleanup bfd_generic_close_and_cleanup
|
||||||
|
#define trad_unix_set_section_contents (PROTO(boolean, (*), \
|
||||||
|
(bfd *abfd, asection *section, PTR data, file_ptr offset, \
|
||||||
|
bfd_size_type count))) bfd_false
|
||||||
|
#define trad_unix_get_section_contents bfd_generic_get_section_contents
|
||||||
|
#define trad_unix_new_section_hook (PROTO (boolean, (*), \
|
||||||
|
(bfd *, sec_ptr))) bfd_true
|
||||||
|
#define trad_unix_get_symtab_upper_bound bfd_0u
|
||||||
|
#define trad_unix_get_symtab (PROTO (unsigned int, (*), \
|
||||||
|
(bfd *, struct symbol_cache_entry **))) bfd_0u
|
||||||
|
#define trad_unix_get_reloc_upper_bound (PROTO (unsigned int, (*), \
|
||||||
|
(bfd *, sec_ptr))) bfd_0u
|
||||||
|
#define trad_unix_canonicalize_reloc (PROTO (unsigned int, (*), \
|
||||||
|
(bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0u
|
||||||
|
#define trad_unix_make_empty_symbol (PROTO ( \
|
||||||
|
struct symbol_cache_entry *, (*), (bfd *))) bfd_false
|
||||||
|
#define trad_unix_print_symbol (PROTO (void, (*), \
|
||||||
|
(bfd *, PTR, struct symbol_cache_entry *, \
|
||||||
|
bfd_print_symbol_type))) bfd_false
|
||||||
|
#define trad_unix_get_lineno (PROTO (alent *, (*), \
|
||||||
|
(bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr
|
||||||
|
#define trad_unix_set_arch_mach (PROTO (boolean, (*), \
|
||||||
|
(bfd *, enum bfd_architecture, unsigned long))) bfd_false
|
||||||
|
#define trad_unix_find_nearest_line (PROTO (boolean, (*), \
|
||||||
|
(bfd *abfd, struct sec *section, \
|
||||||
|
struct symbol_cache_entry **symbols,bfd_vma offset, \
|
||||||
|
CONST char **file, CONST char **func, unsigned int *line))) bfd_false
|
||||||
|
#define trad_unix_sizeof_headers (PROTO (int, (*), \
|
||||||
|
(bfd *, boolean))) bfd_0
|
||||||
|
|
||||||
|
#define trad_unix_bfd_debug_info_start bfd_void
|
||||||
|
#define trad_unix_bfd_debug_info_end bfd_void
|
||||||
|
#define trad_unix_bfd_debug_info_accumulate (PROTO (void, (*), \
|
||||||
|
(bfd *, struct sec *))) bfd_void
|
||||||
|
|
||||||
|
|
||||||
|
bfd_target trad_core_big_vec =
|
||||||
|
{
|
||||||
|
"trad-core-big",
|
||||||
|
bfd_target_unknown_flavour,
|
||||||
|
true, /* target byte order */
|
||||||
|
true, /* target headers byte order */
|
||||||
|
(HAS_RELOC | EXEC_P | /* object flags */
|
||||||
|
HAS_LINENO | HAS_DEBUG |
|
||||||
|
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||||
|
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
|
||||||
|
' ', /* ar_pad_char */
|
||||||
|
16, /* ar_max_namelen */
|
||||||
|
3, /* minimum alignment power */
|
||||||
|
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */
|
||||||
|
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */
|
||||||
|
|
||||||
|
{_bfd_dummy_target, _bfd_dummy_target,
|
||||||
|
_bfd_dummy_target, trad_unix_core_file_p},
|
||||||
|
{bfd_false, bfd_false, /* bfd_create_object */
|
||||||
|
bfd_false, bfd_false},
|
||||||
|
{bfd_false, bfd_false, /* bfd_write_contents */
|
||||||
|
bfd_false, bfd_false},
|
||||||
|
|
||||||
|
JUMP_TABLE(trad_unix)
|
||||||
|
};
|
||||||
|
|
||||||
|
bfd_target trad_core_little_vec =
|
||||||
|
{
|
||||||
|
"trad-core-little",
|
||||||
|
bfd_target_unknown_flavour,
|
||||||
|
false, /* target byte order */
|
||||||
|
false, /* target headers byte order */
|
||||||
|
(HAS_RELOC | EXEC_P | /* object flags */
|
||||||
|
HAS_LINENO | HAS_DEBUG |
|
||||||
|
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
||||||
|
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
|
||||||
|
' ', /* ar_pad_char */
|
||||||
|
16, /* ar_max_namelen */
|
||||||
|
3, /* minimum alignment power */
|
||||||
|
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putb16,
|
||||||
|
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16,
|
||||||
|
|
||||||
|
{_bfd_dummy_target, _bfd_dummy_target,
|
||||||
|
_bfd_dummy_target, trad_unix_core_file_p},
|
||||||
|
{bfd_false, bfd_false, /* bfd_create_object */
|
||||||
|
bfd_false, bfd_false},
|
||||||
|
{bfd_false, bfd_false, /* bfd_write_contents */
|
||||||
|
bfd_false, bfd_false},
|
||||||
|
|
||||||
|
JUMP_TABLE(trad_unix)
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue