#include <ansidecl.h>
#include <sysdep.h>
-struct external_exec;
#include <a.out.sun4.h>
#include "bfd.h"
#include "libaout.h"
static void
DEFUN(swapcore_sun3,(abfd, ext, intcore),
bfd *abfd AND
- char *ext;
+ char *ext AND
struct internal_sunos_core *intcore)
{
- struct external_exec exec_bytes;
struct external_sun3_core *extcore = (struct external_sun3_core *)ext;
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_magic);
}
-/* byte-swap in the Sun-3 core structure */
+/* byte-swap in the Sparc core structure */
static void
DEFUN(swapcore_sparc,(abfd, ext, intcore),
bfd *abfd AND
- char *ext;
+ char *ext AND
struct internal_sunos_core *intcore)
{
struct external_sparc_core *extcore = (struct external_sparc_core *)ext;
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *)extcore);
/* Supposedly the user stack grows downward from the bottom of kernel memory.
Presuming that this remains true, this definition will work. */
-#define USRSTACK (-(128*1024*1024))
- intcore->c_stacktop = USRSTACK; /* By experimentation */
-#undef USRSTACK
+#define SPARC_USRSTACK (-(128*1024*1024))
+ intcore->c_stacktop = SPARC_USRSTACK; /* By experimentation */
}
/* need this cast because ptr is really void * */
int core_mag;
struct internal_sunos_core *core;
char *extcore;
- char *rawptr;
struct mergem {
struct suncoredata suncoredata;
struct internal_sunos_core internal_sunos_core;
if (core_stacksec (abfd) == NULL) {
loser:
bfd_error = no_memory;
- bfd_release (abfd, rawptr);
+ bfd_release (abfd, (char *)mergem);
return 0;
}
core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
core_regsec (abfd)->name = ".reg";
core_reg2sec (abfd)->name = ".reg2";
- core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD;
- core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD;
- core_regsec (abfd)->flags = SEC_ALLOC;
- core_reg2sec (abfd)->flags = SEC_ALLOC;
+ core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
+ core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
+ core_regsec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
+ core_reg2sec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
core_stacksec (abfd)->size = core->c_ssize;
core_datasec (abfd)->size = core->c_dsize;
return false;
}
- return (bcmp ((char *)&core_hdr (core_bfd), (char*) &exec_hdr (exec_bfd),
+ return (bcmp ((char *)&core_hdr (core_bfd)->c_aouthdr,
+ (char *) exec_hdr (exec_bfd),
sizeof (struct internal_exec)) == 0) ? true : false;
}
\f