/* IBM RS/6000 "XCOFF" back-end for BFD.
- Copyright 2001, 2002
+ Copyright 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Tom Rix
- Contributed by Redhat.
+ Contributed by Red Hat Inc.
This file is part of BFD, the Binary File Descriptor library.
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., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
#include "bfd.h"
+const bfd_target *xcoff64_core_p (bfd *);
+bfd_boolean xcoff64_core_file_matches_executable_p (bfd *, bfd *);
+char *xcoff64_core_file_failing_command (bfd *);
+int xcoff64_core_file_failing_signal (bfd *);
+
#ifdef AIX_5_CORE
#include "sysdep.h"
#include "libbfd.h"
-const bfd_target *xcoff64_core_p
- PARAMS ((bfd *));
-bfd_boolean xcoff64_core_file_matches_executable_p
- PARAMS ((bfd *, bfd *));
-char *xcoff64_core_file_failing_command
- PARAMS ((bfd *));
-int xcoff64_core_file_failing_signal
- PARAMS ((bfd *));
-
/* Aix 5.1 system include file. */
/* Need to define this macro so struct ld_info64 get included. */
((bfd_signed_vma)(v) < 0 || (bfd_signed_vma)(v) > (bfd_signed_vma)(s).st_size)
const bfd_target *
-xcoff64_core_p (abfd)
- bfd *abfd;
+xcoff64_core_p (bfd *abfd)
{
struct core_dumpxx core, *new_core_hdr;
struct stat statbuf;
bfd_vma ld_offset;
bfd_size_type i;
struct vm_infox vminfo;
- bfd_target *return_value = NULL;
+ const bfd_target *return_value = NULL;
/* Get the header. */
if (bfd_seek (abfd, 0, SEEK_SET) != 0)
|| (! (core.c_flag & LE_VALID)))
goto xcoff64_core_p_error;
- /* Check for trucated stack or general truncating. */
+ /* Check for truncated stack or general truncating. */
if ((! (core.c_flag & USTACK_VALID))
|| (core.c_flag & CORE_TRUNC))
{
return return_value;
}
- new_core_hdr = (struct core_dumpxx *)
- bfd_zalloc (abfd, sizeof (struct core_dumpxx));
+ new_core_hdr = bfd_zalloc (abfd, sizeof (struct core_dumpxx));
if (NULL == new_core_hdr)
return return_value;
memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx));
- core_hdr(abfd) = (char *)new_core_hdr;
+ /* The core_hdr() macro is no longer used here because it would
+ expand to code relying on gcc's cast-as-lvalue extension,
+ which was removed in gcc 4.0. */
+ abfd->tdata.any = new_core_hdr;
/* .stack section. */
sec = bfd_make_section_anyway (abfd, ".stack");
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
- sec->_raw_size = core.c_size;
+ sec->size = core.c_size;
sec->vma = core.c_stackorg;
sec->filepos = core.c_stack;
return return_value;
sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY;
- sec->_raw_size = sizeof (struct __context64);
+ sec->size = sizeof (struct __context64);
sec->vma = 0;
sec->filepos = 0;
sec->contents = (bfd_byte *)&new_core_hdr->c_flt.r64;
return return_value;
sec->flags = SEC_HAS_CONTENTS;
- sec->_raw_size = core.c_lsize;
+ sec->size = core.c_lsize;
sec->vma = 0;
sec->filepos = core.c_loader;
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
- sec->_raw_size = core.c_datasize;
+ sec->size = core.c_datasize;
sec->vma = core.c_dataorg;
sec->filepos = core.c_data;
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
- sec->_raw_size = ldinfo.ldinfo_datasize;
+ sec->size = ldinfo.ldinfo_datasize;
sec->vma = ldinfo.ldinfo_dataorg;
sec->filepos = ldinfo.ldinfo_core;
}
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
- sec->_raw_size = vminfo.vminfo_size;
+ sec->size = vminfo.vminfo_size;
sec->vma = vminfo.vminfo_addr;
sec->filepos = vminfo.vminfo_offset;
}
}
- return_value = abfd->xvec; /* This is garbage for now. */
+ return_value = (bfd_target *) abfd->xvec; /* This is garbage for now. */
xcoff64_core_p_error:
if (bfd_get_error () != bfd_error_system_call)
/* Return `TRUE' if given core is from the given executable. */
bfd_boolean
-xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
- bfd *core_bfd;
- bfd *exec_bfd;
+xcoff64_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
{
struct core_dumpxx core;
char *path, *s;
}
char *
-xcoff64_core_file_failing_command (abfd)
- bfd *abfd;
+xcoff64_core_file_failing_command (bfd *abfd)
{
struct core_dumpxx *c = core_hdr (abfd);
char *return_value = 0;
}
int
-xcoff64_core_file_failing_signal (abfd)
- bfd *abfd;
+xcoff64_core_file_failing_signal (bfd *abfd)
{
struct core_dumpxx *c = core_hdr (abfd);
int return_value = 0;
#else /* AIX_5_CORE */
-const bfd_target *xcoff64_core_p
- PARAMS ((bfd *));
-bfd_boolean xcoff64_core_file_matches_executable_p
- PARAMS ((bfd *, bfd *));
-char *xcoff64_core_file_failing_command
- PARAMS ((bfd *));
-int xcoff64_core_file_failing_signal
- PARAMS ((bfd *));
-
const bfd_target *
-xcoff64_core_p (abfd)
- bfd *abfd ATTRIBUTE_UNUSED;
+xcoff64_core_p (bfd *abfd ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_wrong_format);
return 0;
}
bfd_boolean
-xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
- bfd *core_bfd ATTRIBUTE_UNUSED;
- bfd *exec_bfd ATTRIBUTE_UNUSED;
+xcoff64_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
{
- return FALSE;
+ return generic_core_file_matches_executable_p (core_bfd, exec_bfd);
}
char *
-xcoff64_core_file_failing_command (abfd)
- bfd *abfd ATTRIBUTE_UNUSED;
+xcoff64_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED)
{
return 0;
}
int
-xcoff64_core_file_failing_signal (abfd)
- bfd *abfd ATTRIBUTE_UNUSED;
+xcoff64_core_file_failing_signal (bfd *abfd ATTRIBUTE_UNUSED)
{
return 0;
}