aboutsummaryrefslogtreecommitdiff
path: root/bfd/aoutf1.h
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-10-11 10:11:37 +0000
committerJohn Gilmore <gnu@cygnus>1991-10-11 10:11:37 +0000
commitbbc8d4849feb14c71603164f5acde4aa58e7b44e (patch)
tree7a3e41c4bf203d68e0b093782a8e125a32124394 /bfd/aoutf1.h
parent600d4864081c1969a5575f91564d8cb21c8e6807 (diff)
downloadgdb-bbc8d4849feb14c71603164f5acde4aa58e7b44e.zip
gdb-bbc8d4849feb14c71603164f5acde4aa58e7b44e.tar.gz
gdb-bbc8d4849feb14c71603164f5acde4aa58e7b44e.tar.bz2
Include bfd.h before sysdep.h, so ansidecl and PROTO() get defined first.
Diffstat (limited to 'bfd/aoutf1.h')
-rw-r--r--bfd/aoutf1.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h
index cc5fc74..622611c 100644
--- a/bfd/aoutf1.h
+++ b/bfd/aoutf1.h
@@ -18,13 +18,13 @@ 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. */
-#include <ansidecl.h>
-#include <sysdep.h>
-#include <a.out.sun4.h>
#include "bfd.h"
-#include "libaout.h"
+#include "sysdep.h"
#include "libbfd.h"
+#include <a.out.sun4.h>
+#include "libaout.h"
+
#include "aout64.h"
#include "stab.gnu.h"
#include "ar.h"
@@ -62,19 +62,22 @@ bfd_target *
DEFUN(NAME(sunos,object_p), (abfd),
bfd *abfd)
{
- unsigned char magicbuf[4]; /* Raw bytes of magic number from file */
- unsigned long magic; /* Swapped magic number */
+ struct external_exec exec_bytes; /* Raw exec header from file */
+ struct internal_exec exec; /* Cleaned-up exec header */
- bfd_error = system_call_error;
-
- if (bfd_read ((PTR)magicbuf, 1 , 4, 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 (exec)) return 0;
- if (N_BADMAG (*((struct internal_exec *) &magic))) return 0;
+ NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
- return NAME(aout,some_aout_object_p) (abfd, sunos4_callback);
+ return NAME(aout,some_aout_object_p) (abfd, &exec, sunos4_callback);
}
/* Determine the size of a relocation entry, based on the architecture */