diff options
author | John Gilmore <gnu@cygnus> | 1991-10-11 04:51:42 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-10-11 04:51:42 +0000 |
commit | 6a469027327f00bc96ad8bb3d17d15d8c41ab20f (patch) | |
tree | d008583329a3da59d7868f657b12efff263e94bc /bfd/newsos3.c | |
parent | 074274252f942a2660c310218943f2aa4ef2e237 (diff) | |
download | gdb-6a469027327f00bc96ad8bb3d17d15d8c41ab20f.zip gdb-6a469027327f00bc96ad8bb3d17d15d8c41ab20f.tar.gz gdb-6a469027327f00bc96ad8bb3d17d15d8c41ab20f.tar.bz2 |
* 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).
Diffstat (limited to 'bfd/newsos3.c')
-rw-r--r-- | bfd/newsos3.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/bfd/newsos3.c b/bfd/newsos3.c index 588e56b..1a35109 100644 --- a/bfd/newsos3.c +++ b/bfd/newsos3.c @@ -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 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define TARGET_BYTE_ORDER_BIG_P 1 - #define PAGE_SIZE 4096 #define SEGMENT_SIZE PAGE_SIZE #define TEXT_START_ADDR 0 @@ -54,19 +52,21 @@ bfd_target * DEFUN(newsos3_object_p,(abfd), bfd *abfd) { - unsigned char magicbuf[4]; /* Raw bytes of magic number from file */ - unsigned long magic; /* Swapped magic number */ - - bfd_error = system_call_error; + struct external_exec exec_bytes; + struct internal_exec exec; - if (bfd_read ((PTR)magicbuf, 1, sizeof (magicbuf), abfd) != - sizeof (magicbuf)) + if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd) + != EXEC_BYTES_SIZE) { + bfd_error = wrong_format; return 0; - magic = bfd_h_get_32 (abfd, magicbuf); + } + + exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info); - if (N_BADMAG (*((struct internal_exec *) &magic))) return 0; + if (N_BADMAG (exec)) return 0; - return aout_32_some_aout_object_p (abfd, newsos3_callback); + 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 */ |