This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to bfd/aix5ppc-core.c for gdb-6.3 with gcc 4 on AIX5.1


Hi Rodney,

Are you using a gcc 4.1 development compiler?

Yes - but I am not compiling under AIX. I do not have access to an AIX5.1 system, so when I built a cross compiler the build system must have left out the core file support. Silly me.


I assumed that using the accessor macro was the preferred mechanism.

It is, but when the macro is tied to a single particular function it really ought to be defined inside the function. That way if the code is ever rearranged it will not be lost.


So - what do you think of the attached, simplified patch ?  If it fixes
the compile time warning then I would be happy to check it in.

Cheers
  Nick


Index: bfd/aix5ppc-core.c
===================================================================
RCS file: /cvs/src/src/bfd/aix5ppc-core.c,v
retrieving revision 1.11
diff -c -3 -p -r1.11 aix5ppc-core.c
*** bfd/aix5ppc-core.c	18 Jul 2005 14:13:33 -0000	1.11
--- bfd/aix5ppc-core.c	8 Aug 2005 12:24:45 -0000
***************
*** 1,5 ****
  /* IBM RS/6000 "XCOFF" back-end for BFD.
!    Copyright 2001, 2002, 2003, 2004
     Free Software Foundation, Inc.
     Written by Tom Rix
     Contributed by Red Hat Inc.
--- 1,5 ----
  /* IBM RS/6000 "XCOFF" back-end for BFD.
!    Copyright 2001, 2002, 2003, 2004, 2005
     Free Software Foundation, Inc.
     Written by Tom Rix
     Contributed by Red Hat Inc.
*************** xcoff64_core_p (bfd *abfd)
*** 55,61 ****
    bfd_vma ld_offset;
    bfd_size_type i;
    struct vm_infox vminfo;
!   bfd_target *return_value = NULL;
  
    /* Get the header.  */
    if (bfd_seek (abfd, 0, SEEK_SET) != 0)
--- 55,61 ----
    bfd_vma ld_offset;
    bfd_size_type i;
    struct vm_infox vminfo;
!   const bfd_target *return_value = NULL;
  
    /* Get the header.  */
    if (bfd_seek (abfd, 0, SEEK_SET) != 0)
*************** xcoff64_core_p (bfd *abfd)
*** 111,117 ****
      return return_value;
  
    memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx));
!   core_hdr(abfd) = (char *)new_core_hdr;
  
    /* .stack section.  */
    sec = bfd_make_section_anyway (abfd, ".stack");
--- 111,120 ----
      return return_value;
  
    memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx));
!   /* The core_hdr() macro is not used here because it would be
!      casting the LHS of an assignment and some versions of gcc
!      will generate a warning for this.  */
!   abfd->tdata.any = new_core_hdr;
  
    /* .stack section.  */
    sec = bfd_make_section_anyway (abfd, ".stack");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]