[RFA/hpux] Implement file_matches_executable_p

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
Hello,

The attached patch implements file_matches_executable_p for HP/UX.
The intent is to have GDB print a little warning when core file and
executable name do not match, as it already does on x86-linux.

While at it, I saw that the file could use a bit of ansification,
and a touch of cleanup, plus some comment addition.

        * hpux-core.c: ANSIfy function declarations and prototypes.
        (thread_section_p): Add comment.
        (hpux_core_core_file_matches_executable_p): Add full implementation.

Tested on pa-hpux using GDB. No warning before the modification, the
warning appears after.

OK to apply?

Thanks,
--
Joel

hpux.diff (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Daniel Jacobowitz-2
On Fri, Nov 11, 2005 at 06:04:52PM -0800, Joel Brobecker wrote:

> Hello,
>
> The attached patch implements file_matches_executable_p for HP/UX.
> The intent is to have GDB print a little warning when core file and
> executable name do not match, as it already does on x86-linux.
>
> While at it, I saw that the file could use a bit of ansification,
> and a touch of cleanup, plus some comment addition.
>
>         * hpux-core.c: ANSIfy function declarations and prototypes.
>         (thread_section_p): Add comment.
>         (hpux_core_core_file_matches_executable_p): Add full implementation.
>
> Tested on pa-hpux using GDB. No warning before the modification, the
> warning appears after.
>
> OK to apply?

Silly question but... there's nothing HP/UX specific in this.  It just
uses bfd_core_file_failing_command.  Why can't this be a generic
implementation?

It looks like ELF offers both failing command and failing program, and
we want to use failing program.  But for any target that doesn't do
that, your implementation is probably good.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
> Silly question but... there's nothing HP/UX specific in this.  It just
> uses bfd_core_file_failing_command.  Why can't this be a generic
> implementation?

No specific reason indeed. So you are suggesting that I write a generic
function, and then call this function from the hpux-core function?

If yes, what would be the appropriate location for that new function?
How about corefile.c?

--
Joel
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Daniel Jacobowitz-2
On Sun, Nov 13, 2005 at 01:00:34PM -0800, Joel Brobecker wrote:
> > Silly question but... there's nothing HP/UX specific in this.  It just
> > uses bfd_core_file_failing_command.  Why can't this be a generic
> > implementation?
>
> No specific reason indeed. So you are suggesting that I write a generic
> function, and then call this function from the hpux-core function?

Yes; more generally (a) you can define the relevant method directly to
the generic function, no need to wrap it, and (b) might as well call it
from every currently stubbed out implementation of this function and
get them all at once.

> If yes, what would be the appropriate location for that new function?
> How about corefile.c?

Sounds fine to me.  Probably libbfd.h for the prototype.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
>
> Yes; more generally (a) you can define the relevant method directly to
> the generic function, no need to wrap it, and (b) might as well call it
> from every currently stubbed out implementation of this function and
> get them all at once.

The attached patch should be better. The only part I wasn't sure about
is regarding the stubbed out implementations. How to I find them?

2005-11-16  Joel Brobecker  <[hidden email]>

        * corefile.c (generic_core_file_matches_executable_p): New function.
        * libbfd.h (generic_core_file_matches_executable_p): Add declaration.
        * hpux-core.c: ANSIfy function declarations and prototypes.
        (thread_section_p): Add comment.
        (hpux_core_core_file_matches_executable_p): Delete.
        (hpux_core_vec): Change the matches_executable_p method to
        use generic_core_file_matches_executable_p.

OK to apply?

Thanks,
--
Joel

core.diff (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Daniel Jacobowitz-2
On Wed, Nov 16, 2005 at 05:14:31PM -0800, Joel Brobecker wrote:
> >
> > Yes; more generally (a) you can define the relevant method directly to
> > the generic function, no need to wrap it, and (b) might as well call it
> > from every currently stubbed out implementation of this function and
> > get them all at once.
>
> The attached patch should be better. The only part I wasn't sure about
> is regarding the stubbed out implementations. How to I find them?

Very simple: you grep for file_matches_executable_p :-)  If anyone
didn't give theirs the obvious name, well, too bad for them.

> @@ -433,7 +416,9 @@ const bfd_target hpux_core_vec =
>  
>      BFD_JUMP_TABLE_GENERIC (_bfd_generic),
>      BFD_JUMP_TABLE_COPY (_bfd_generic),
> -    BFD_JUMP_TABLE_CORE (hpux_core),
> +    hpux_core_core_file_failing_command,
> +    hpux_core_core_file_failing_signal,
> +    generic_core_file_matches_executable_p,
>      BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
>      BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols),
>      BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),

You can just do this instead:
#define hpux_core_file_matches_executable_p generic_core_file_matches_executable_p

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Daniel Jacobowitz-2
In reply to this post by Joel Brobecker
On Wed, Nov 16, 2005 at 05:14:31PM -0800, Joel Brobecker wrote:
>         * libbfd.h (generic_core_file_matches_executable_p): Add declaration.

Oh - and this is a generated file, sorry for not mentioning that
earlier.  If you used emacs it would have told you :-)

You can put the prototype in the implementation and have it added here
automatically.


--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Alan Modra
In reply to this post by Joel Brobecker
On Wed, Nov 16, 2005 at 05:14:31PM -0800, Joel Brobecker wrote:

> @@ -155,6 +144,10 @@ thread_section_p (bfd *abfd ATTRIBUTE_UN
>                    asection *sect,
>                    void *obj ATTRIBUTE_UNUSED)
>  {
> +  /* The ATTRIBUTE_UNUSED for parameter ABFD is at first sight surprising,
> +     since it appears to be used in the call to bfd_section_name.  However,
> +     bfd_section_name is a macro that doesn't use the first parameter,
> +     so the attribute above is perfectly justified.  */
>    return (strncmp (bfd_section_name (abfd, sect), ".reg/", 5) == 0);
>  }

I dislike these silly macros too.  Just use sect->name and you can do
without the comment.  Lots less typing.

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
In reply to this post by Daniel Jacobowitz-2
> Very simple: you grep for file_matches_executable_p :-)  If anyone
> didn't give theirs the obvious name, well, too bad for them.

Oh no :-). This is the answer I didn't want to hear. Is this OK if
I do this in a separate patch? I'm working on it right now, but
this breaks down a bit the size of the overall change.

> You can just do this instead:
> #define hpux_core_file_matches_executable_p generic_core_file_matches_executable_p

Clever. Implemented as suggested.

One bad point for me, I knew that libbfd.h was generated. For some
reason I forgot to include libbfd-in.h in the patch.

I also implemented AlanM's suggestion of losing a macro and expanding
it manually.

2005-11-17  Joel Brobecker  <[hidden email]>

        * corefile.c (generic_core_file_matches_executable_p): New function.
        * libbfd-in.h (generic_core_file_matches_executable_p): Add
        declaration.
        * libbfd.h: Regenerate.
        * hpux-core.c: ANSIfy function declarations and prototypes.
        (thread_section_p): Manually expand bfd_section_name macro
        to make it clear that parameter ABFD is not used.
        (hpux_core_core_file_matches_executable_p): Delete, replaced
        by macro pointing to generic_core_file_matches_executable_p.

Now, on to the other maches_executable_p function bodies...

--
Joel

hpux.diff (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
> 2005-11-17  Joel Brobecker  <[hidden email]>
>
>         * corefile.c (generic_core_file_matches_executable_p): New function.
>         * libbfd-in.h (generic_core_file_matches_executable_p): Add
>         declaration.
>         * libbfd.h: Regenerate.
>         * hpux-core.c: ANSIfy function declarations and prototypes.
>         (thread_section_p): Manually expand bfd_section_name macro
>         to make it clear that parameter ABFD is not used.
>         (hpux_core_core_file_matches_executable_p): Delete, replaced
>         by macro pointing to generic_core_file_matches_executable_p.

Commenting on my own code...

> +  exec = bfd_get_filename (exec_bfd);
> +  last_slash = strrchr (exec, '/');
> +  if (last_slash != NULL)
> +    exec = last_slash + 1;
> +  
> +  /* The cast below is to avoid a compiler warning due to the assignment
> +     of the const char * returned by bfd_core_file_failing_command to a
> +     non-const char *.  In this case, the assignement does not lead to
> +     breaking the const, as we're only reading the string.  */
> +    
> +  core = (char *) bfd_core_file_failing_command (core_bfd);
> +  last_slash = strrchr (core, '/');
> +  if (last_slash != NULL)
> +    core = last_slash + 1;
> +
> +  return (strcmp(exec, core) == 0);

I would suggest two modifications:

  1. Revert the order, and compute core first. If we can't
     get a name (ie get NULL), then return immediately.
     Return which value though? I think we should return 0,
     but this may cause warnings in GDB that weren't there
     before. I do expect that most of the time, the user will
     be using the correct core file, but I think it's better
     to warn when we're not sure.

  2. I think I need to add some guards against a null core.
     I looked at a draft of the C90 standard, and it doesn't
     say how well it reacts to a null string... Should I also
     do the same for exec? I don't think that bfd_get_filename
     can ever return a null string, right?

I thought about the above while working on replacing the stubbed
instances of core_file_matches_executable_p...

--
Joel
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
In reply to this post by Joel Brobecker
> Now, on to the other maches_executable_p function bodies...

One question: I've seen two instances of the following case:

    char *
    cisco_core_file_failing_command (abfd)
         bfd *abfd ATTRIBUTE_UNUSED;
    {
      return NULL;
    }
   
    int
    cisco_core_file_failing_signal (abfd)
         bfd *abfd ATTRIBUTE_UNUSED;
    {
      return abfd->tdata.cisco_core_data->sig;
    }
   
    bfd_boolean
    cisco_core_file_matches_executable_p (core_bfd, exec_bfd)
         bfd *core_bfd ATTRIBUTE_UNUSED;
         bfd *exec_bfd ATTRIBUTE_UNUSED;
    {
      return TRUE;
    }

I can remove the target specific core_file_matches_executable_p,
and replace it with the generic one. It is a bit less efficient
though. Should I proceed with the replacement anyway?

--
Joel
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Daniel Jacobowitz-2
On Thu, Nov 17, 2005 at 05:14:00PM -0800, Joel Brobecker wrote:
> I can remove the target specific core_file_matches_executable_p,
> and replace it with the generic one. It is a bit less efficient
> though. Should I proceed with the replacement anyway?

Efficiency really doesn't matter for this.  I'd rather reduce the
duplication of BFD than save a couple of instructions during a GDB
session.

Just my opinion, but...

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Daniel Jacobowitz-2
In reply to this post by Joel Brobecker
On Thu, Nov 17, 2005 at 05:04:39PM -0800, Joel Brobecker wrote:
>   1. Revert the order, and compute core first. If we can't
>      get a name (ie get NULL), then return immediately.
>      Return which value though? I think we should return 0,
>      but this may cause warnings in GDB that weren't there
>      before. I do expect that most of the time, the user will
>      be using the correct core file, but I think it's better
>      to warn when we're not sure.

If we can't extract a failing command from the core file, then why
bother warning?  There's no way the user can shut it up.  Seems rude.

>   2. I think I need to add some guards against a null core.
>      I looked at a draft of the C90 standard, and it doesn't
>      say how well it reacts to a null string... Should I also
>      do the same for exec? I don't think that bfd_get_filename
>      can ever return a null string, right?

In general you can never pass NULL to standard library functions that
expect strings.  Always check first.  I don't think you have to worry
about bfd_get_filename though.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
Is the following better?

2005-11-17  Joel Brobecker  <[hidden email]>

        * corefile.c (generic_core_file_matches_executable_p): New function.
        * libbfd-in.h (generic_core_file_matches_executable_p): Add
        declaration.
        * libbfd.h: Regenerate.
        * hpux-core.c: ANSIfy function declarations and prototypes.
        (thread_section_p): Manually expand bfd_section_name macro
        to make it clear that parameter ABFD is not used.
        (hpux_core_core_file_matches_executable_p): Delete, replaced
        by macro pointing to generic_core_file_matches_executable_p.

        * aix386-core.c: Replace core_file_matches_executable_p null
        implementation by generic_core_file_matches_executable_p by
        using a macro.
        * aix5ppc-core.c: Likewise.
        * cisco-core.c: Likewise.
        * hppabsd-core.c: Likewise.
        * irix-core.c: Likewise.
        * lynx-core.c: Likewise.
        * mach-o.c: Likewise.
        * netbsd-core.c: Likewise.
        * osf-core.c: Likewise.
        * ptrace-core.c: Likewise.
        * sco5-core.c: Likewise.
        * trad-core.c: Likewise.

I'm slightly concerned by some of the files where I didn't see any
advance declaration. I couldn't find any, so I assume there wasn't
any, and simply replace the function body by the #define. Hopefully
I didn't break anything...

Tested on pa-hpux.

Thanks,
--
Joel

cmd.diff (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
Ping? No rush though, I'll soon be off email (sortof) and won't be back
until monday. Just making sure it didn't fall through the cracks.

Thank you!

On Thu, Nov 24, 2005 at 06:54:51PM -0800, Joel Brobecker wrote:

> Is the following better?
>
> 2005-11-17  Joel Brobecker  <[hidden email]>
>
>         * corefile.c (generic_core_file_matches_executable_p): New function.
>         * libbfd-in.h (generic_core_file_matches_executable_p): Add
>         declaration.
>         * libbfd.h: Regenerate.
>         * hpux-core.c: ANSIfy function declarations and prototypes.
>         (thread_section_p): Manually expand bfd_section_name macro
>         to make it clear that parameter ABFD is not used.
>         (hpux_core_core_file_matches_executable_p): Delete, replaced
>         by macro pointing to generic_core_file_matches_executable_p.
>
>         * aix386-core.c: Replace core_file_matches_executable_p null
>         implementation by generic_core_file_matches_executable_p by
>         using a macro.
>         * aix5ppc-core.c: Likewise.
>         * cisco-core.c: Likewise.
>         * hppabsd-core.c: Likewise.
>         * irix-core.c: Likewise.
>         * lynx-core.c: Likewise.
>         * mach-o.c: Likewise.
>         * netbsd-core.c: Likewise.
>         * osf-core.c: Likewise.
>         * ptrace-core.c: Likewise.
>         * sco5-core.c: Likewise.
>         * trad-core.c: Likewise.
>
> I'm slightly concerned by some of the files where I didn't see any
> advance declaration. I couldn't find any, so I assume there wasn't
> any, and simply replace the function body by the #define. Hopefully
> I didn't break anything...
>
> Tested on pa-hpux.
>
> Thanks,
> --
> Joel

> Index: corefile.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/corefile.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 corefile.c
> --- corefile.c 5 Oct 2005 21:24:23 -0000 1.10
> +++ corefile.c 25 Nov 2005 02:39:54 -0000
> @@ -107,3 +107,59 @@ core_file_matches_executable_p (bfd *cor
>    return BFD_SEND (core_bfd, _core_file_matches_executable_p,
>     (core_bfd, exec_bfd));
>  }
> +
> +/*
> +FUNCTION
> +        generic_core_file_matches_executable_p
> +
> +SYNOPSIS
> +        bfd_boolean generic_core_file_matches_executable_p
> +          (bfd *core_bfd, bfd *exec_bfd)
> +
> +DESCRIPTION
> +        Return TRUE if the core file attached to @var{core_bfd}
> +        was generated by a run of the executable file attached
> +        to @var{exec_bfd}.  The match is based on executable
> +        basenames only.
> +
> +        Note: When not able to determine the core file failing
> +        command or the executable name, we still return TRUE even
> +        though we're not sure that core file and executable match.
> +        This is to avoid generating a false warning in situations
> +        where we really don't know whether they match or not.
> +*/
> +
> +bfd_boolean
> +generic_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
> +{
> +  char *exec;
> +  char *core;
> +  char *last_slash;
> +
> +  if (exec_bfd == NULL || core_bfd == NULL)
> +    return TRUE;
> +
> +  /* The cast below is to avoid a compiler warning due to the assignment
> +     of the const char * returned by bfd_core_file_failing_command to a
> +     non-const char *.  In this case, the assignement does not lead to
> +     breaking the const, as we're only reading the string.  */
> +    
> +  core = (char *) bfd_core_file_failing_command (core_bfd);
> +  if (core == NULL)
> +    return TRUE;
> +
> +  exec = bfd_get_filename (exec_bfd);
> +  if (exec == NULL)
> +    return TRUE;
> +
> +  last_slash = strrchr (core, '/');
> +  if (last_slash != NULL)
> +    core = last_slash + 1;
> +
> +  last_slash = strrchr (exec, '/');
> +  if (last_slash != NULL)
> +    exec = last_slash + 1;
> +  
> +  return (strcmp(exec, core) == 0);
> +}
> +
> Index: libbfd-in.h
> ===================================================================
> RCS file: /cvs/src/src/bfd/libbfd-in.h,v
> retrieving revision 1.59
> diff -u -p -r1.59 libbfd-in.h
> --- libbfd-in.h 3 Nov 2005 16:06:11 -0000 1.59
> +++ libbfd-in.h 25 Nov 2005 02:40:16 -0000
> @@ -247,6 +247,12 @@ extern int _bfd_nocore_core_file_failing
>  extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
>    (bfd *, bfd *);
>  
> +/* A generic implementation of CORE_FILE_MATCHES_EXECUTABLE_P that
> +   is independent of the target.  */
> +
> +extern bfd_boolean generic_core_file_matches_executable_p
> +  (bfd *core_bfd, bfd *exec_bfd);
> +
>  /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
>     file support.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive).  */
>  
> Index: libbfd.h
> ===================================================================
> RCS file: /cvs/src/src/bfd/libbfd.h,v
> retrieving revision 1.164
> diff -u -p -r1.164 libbfd.h
> --- libbfd.h 8 Nov 2005 11:15:11 -0000 1.164
> +++ libbfd.h 25 Nov 2005 02:40:16 -0000
> @@ -252,6 +252,12 @@ extern int _bfd_nocore_core_file_failing
>  extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
>    (bfd *, bfd *);
>  
> +/* A generic implementation of CORE_FILE_MATCHES_EXECUTABLE_P that
> +   is independent of the target.  */
> +
> +extern bfd_boolean generic_core_file_matches_executable_p
> +  (bfd *core_bfd, bfd *exec_bfd);
> +
>  /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
>     file support.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive).  */
>  
> Index: hpux-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/hpux-core.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 hpux-core.c
> --- hpux-core.c 29 Oct 2005 23:00:12 -0000 1.18
> +++ hpux-core.c 25 Nov 2005 02:40:16 -0000
> @@ -101,29 +101,19 @@ struct hpux_core_struct
>  #define core_command(bfd) (core_hdr(bfd)->cmd)
>  #define core_kernel_thread_id(bfd) (core_hdr(bfd)->lwpid)
>  #define core_user_thread_id(bfd) (core_hdr(bfd)->user_tid)
> +#define hpux_core_core_file_matches_executable_p generic_core_file_matches_executable_p
>  
> -static asection *make_bfd_asection
> -  PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma,
> -   unsigned int));
> -static const bfd_target *hpux_core_core_file_p
> -  PARAMS ((bfd *));
> -static char *hpux_core_core_file_failing_command
> -  PARAMS ((bfd *));
> -static int hpux_core_core_file_failing_signal
> -  PARAMS ((bfd *));
> -static bfd_boolean hpux_core_core_file_matches_executable_p
> -  PARAMS ((bfd *, bfd *));
> -static void swap_abort
> -  PARAMS ((void));
> +static asection *make_bfd_asection (bfd *, const char *, flagword,
> +                                    bfd_size_type, bfd_vma, unsigned int);
> +static const bfd_target *hpux_core_core_file_p (bfd *);
> +static char *hpux_core_core_file_failing_command (bfd *);
> +static int hpux_core_core_file_failing_signal (bfd *);
> +static void swap_abort (void);
>  
>  static asection *
> -make_bfd_asection (abfd, name, flags, size, vma, alignment_power)
> -     bfd *abfd;
> -     const char *name;
> -     flagword flags;
> -     bfd_size_type size;
> -     bfd_vma vma;
> -     unsigned int alignment_power;
> +make_bfd_asection (bfd *abfd, const char *name, flagword flags,
> +                   bfd_size_type size, bfd_vma vma,
> +                   unsigned int alignment_power)
>  {
>    asection *asect;
>    char *newname;
> @@ -155,7 +145,7 @@ thread_section_p (bfd *abfd ATTRIBUTE_UN
>                    asection *sect,
>                    void *obj ATTRIBUTE_UNUSED)
>  {
> -  return (strncmp (bfd_section_name (abfd, sect), ".reg/", 5) == 0);
> +  return (strncmp (sect->name, ".reg/", 5) == 0);
>  }
>  
>  /* this function builds a bfd target if the file is a corefile.
> @@ -168,8 +158,7 @@ thread_section_p (bfd *abfd ATTRIBUTE_UN
>     (I am just guessing here!)
>  */
>  static const bfd_target *
> -hpux_core_core_file_p (abfd)
> -     bfd *abfd;
> +hpux_core_core_file_p (bfd *abfd)
>  {
>    int  good_sections = 0;
>    int  unknown_sections = 0;
> @@ -361,30 +350,21 @@ hpux_core_core_file_p (abfd)
>  }
>  
>  static char *
> -hpux_core_core_file_failing_command (abfd)
> -     bfd *abfd;
> +hpux_core_core_file_failing_command (bfd *abfd)
>  {
>    return core_command (abfd);
>  }
>  
>  static int
> -hpux_core_core_file_failing_signal (abfd)
> -     bfd *abfd;
> +hpux_core_core_file_failing_signal (bfd *abfd)
>  {
>    return core_signal (abfd);
>  }
>  
> -static bfd_boolean
> -hpux_core_core_file_matches_executable_p (core_bfd, exec_bfd)
> -     bfd *core_bfd ATTRIBUTE_UNUSED;
> -     bfd *exec_bfd ATTRIBUTE_UNUSED;
> -{
> -  return TRUE; /* FIXME, We have no way of telling at this point */
> -}
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void
> -swap_abort ()
> +swap_abort (void)
>  {
>    abort(); /* This way doesn't require any declaration for ANSI to fuck up */
>  }
> Index: aix386-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/aix386-core.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 aix386-core.c
> --- aix386-core.c 4 May 2005 15:52:59 -0000 1.14
> +++ aix386-core.c 25 Nov 2005 02:39:45 -0000
> @@ -204,14 +204,7 @@ aix386_core_file_failing_signal (abfd)
>    return core_hdr (abfd)->cd_cursig;
>  }
>  
> -static bfd_boolean
> -aix386_core_file_matches_executable_p (core_bfd, exec_bfd)
> -     bfd *core_bfd;
> -     bfd *exec_bfd;
> -{
> -  /* FIXME: We have no way of telling at this point.  */
> -  return TRUE;
> -}
> +#define aix386_core_file_matches_executable_p generic_core_file_matches_executable_p
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  
> Index: aix5ppc-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/aix5ppc-core.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 aix5ppc-core.c
> --- aix5ppc-core.c 9 Aug 2005 08:56:36 -0000 1.12
> +++ aix5ppc-core.c 25 Nov 2005 02:39:45 -0000
> @@ -319,7 +319,7 @@ xcoff64_core_file_failing_signal (bfd *a
>  #else /* AIX_5_CORE */
>  
>  const bfd_target *xcoff64_core_p  (bfd *);
> -bfd_boolean xcoff64_core_file_matches_executable_p (bfd *, bfd *);
> +#define xcoff64_core_file_matches_executable_p generic_core_file_matches_executable_p
>  char *xcoff64_core_file_failing_command (bfd *);
>  int xcoff64_core_file_failing_signal (bfd *);
>  
> @@ -330,13 +330,6 @@ xcoff64_core_p (bfd *abfd ATTRIBUTE_UNUS
>    return 0;
>  }
>  
> -bfd_boolean
> -xcoff64_core_file_matches_executable_p (bfd *core_bfd ATTRIBUTE_UNUSED,
> - bfd *exec_bfd ATTRIBUTE_UNUSED)
> -{
> -  return FALSE;
> -}
> -
>  char *
>  xcoff64_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED)
>  {
> Index: cisco-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/cisco-core.c,v
> retrieving revision 1.11
> diff -u -p -r1.11 cisco-core.c
> --- cisco-core.c 4 May 2005 15:53:01 -0000 1.11
> +++ cisco-core.c 25 Nov 2005 02:39:48 -0000
> @@ -75,7 +75,7 @@ static const bfd_target *cisco_core_file
>  static const bfd_target *cisco_core_file_p PARAMS ((bfd *));
>  char *cisco_core_file_failing_command PARAMS ((bfd *));
>  int cisco_core_file_failing_signal PARAMS ((bfd *));
> -bfd_boolean cisco_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
> +#define cisco_core_file_matches_executable_p generic_core_file_matches_executable_p
>  
>  /* Examine the file for a crash info struct at the offset given by
>     CRASH_INFO_LOC.  */
> @@ -317,14 +317,6 @@ cisco_core_file_failing_signal (abfd)
>  {
>    return abfd->tdata.cisco_core_data->sig;
>  }
> -
> -bfd_boolean
> -cisco_core_file_matches_executable_p (core_bfd, exec_bfd)
> -     bfd *core_bfd ATTRIBUTE_UNUSED;
> -     bfd *exec_bfd ATTRIBUTE_UNUSED;
> -{
> -  return TRUE;
> -}
>  
>  extern const bfd_target cisco_core_little_vec;
>  
> Index: hppabsd-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/hppabsd-core.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 hppabsd-core.c
> --- hppabsd-core.c 27 Oct 2005 03:35:30 -0000 1.17
> +++ hppabsd-core.c 25 Nov 2005 02:40:15 -0000
> @@ -57,8 +57,7 @@ static char *hppabsd_core_core_file_fail
>    PARAMS ((bfd *));
>  static int hppabsd_core_core_file_failing_signal
>    PARAMS ((bfd *));
> -static bfd_boolean hppabsd_core_core_file_matches_executable_p
> -  PARAMS ((bfd *, bfd *));
> +#define hppabsd_core_core_file_matches_executable_p generic_core_file_matches_executable_p
>  static void swap_abort
>    PARAMS ((void));
>  
> @@ -217,14 +216,6 @@ hppabsd_core_core_file_failing_signal (a
>  {
>    return core_signal (abfd);
>  }
> -
> -static bfd_boolean
> -hppabsd_core_core_file_matches_executable_p (core_bfd, exec_bfd)
> -     bfd *core_bfd, *exec_bfd;
> -{
> -  /* There's no way to know this...  */
> -  return TRUE;
> -}
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void
> Index: irix-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/irix-core.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 irix-core.c
> --- irix-core.c 4 May 2005 15:53:33 -0000 1.17
> +++ irix-core.c 25 Nov 2005 02:40:16 -0000
> @@ -41,6 +41,8 @@ struct sgi_core_struct
>  #define core_signal(bfd) (core_hdr(bfd)->sig)
>  #define core_command(bfd) (core_hdr(bfd)->cmd)
>  
> +#define irix_core_core_file_matches_executable_p generic_core_file_matches_executable_p
> +
>  static asection *make_bfd_asection
>    (bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr);
>  
> @@ -262,13 +264,6 @@ irix_core_core_file_failing_signal (bfd
>    return core_signal (abfd);
>  }
>  
> -static bfd_boolean
> -irix_core_core_file_matches_executable_p (bfd *core_bfd ATTRIBUTE_UNUSED,
> -                                          bfd *exec_bfd ATTRIBUTE_UNUSED)
> -{
> -  return TRUE; /* XXX - FIXME */
> -}
> -
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void
>  swap_abort(void)
> Index: lynx-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/lynx-core.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 lynx-core.c
> --- lynx-core.c 4 May 2005 15:53:35 -0000 1.9
> +++ lynx-core.c 25 Nov 2005 02:40:17 -0000
> @@ -51,6 +51,8 @@ struct lynx_core_struct
>  #define core_signal(bfd) (core_hdr(bfd)->sig)
>  #define core_command(bfd) (core_hdr(bfd)->cmd)
>  
> +#define lynx_core_file_matches_executable_p generic_core_file_matches_executable_p
> +
>  /* Handle Lynx core dump file.  */
>  
>  static asection *
> @@ -225,11 +227,4 @@ lynx_core_file_failing_signal (abfd)
>    return core_signal (abfd);
>  }
>  
> -bfd_boolean
> -lynx_core_file_matches_executable_p  (core_bfd, exec_bfd)
> -     bfd *core_bfd, *exec_bfd;
> -{
> -  return TRUE; /* FIXME, We have no way of telling at this point */
> -}
> -
>  #endif /* LYNX_CORE */
> Index: mach-o.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/mach-o.c,v
> retrieving revision 1.19
> diff -u -p -r1.19 mach-o.c
> --- mach-o.c 23 May 2005 17:44:55 -0000 1.19
> +++ mach-o.c 25 Nov 2005 02:40:17 -0000
> @@ -75,6 +75,7 @@
>  #define bfd_mach_o_bfd_discard_group                  bfd_generic_discard_group
>  #define bfd_mach_o_section_already_linked             _bfd_generic_section_already_linked
>  #define bfd_mach_o_bfd_copy_private_header_data       _bfd_generic_bfd_copy_private_header_data
> +#define bfd_mach_o_core_file_matches_executable_p     generic_core_file_matches_executable_p
>  
>  
>  /* The flags field of a section structure is separated into two parts a section
> @@ -1993,13 +1994,6 @@ bfd_mach_o_core_file_failing_signal (bfd
>    return 0;
>  }
>  
> -bfd_boolean
> -bfd_mach_o_core_file_matches_executable_p (bfd *core_bfd ATTRIBUTE_UNUSED,
> -   bfd *exec_bfd ATTRIBUTE_UNUSED)
> -{
> -  return TRUE;
> -}
> -
>  #define TARGET_NAME mach_o_be_vec
>  #define TARGET_STRING     "mach-o-be"
>  #define TARGET_BIG_ENDIAN 1
> Index: netbsd-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/netbsd-core.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 netbsd-core.c
> --- netbsd-core.c 4 May 2005 15:53:35 -0000 1.23
> +++ netbsd-core.c 25 Nov 2005 02:40:18 -0000
> @@ -42,6 +42,8 @@
>     OpenBSD/sparc64.  */
>  #define SPARC64_WCOOKIE_OFFSET 832
>  
> +#define netbsd_core_file_matches_executable_p generic_core_file_matches_executable_p
> +
>  struct netbsd_core_struct
>  {
>    struct core core;
> @@ -246,14 +248,6 @@ netbsd_core_file_failing_signal (bfd *ab
>    /*return core_signal (abfd);*/
>    return abfd->tdata.netbsd_core_data->core.c_signo;
>  }
> -
> -static bfd_boolean
> -netbsd_core_file_matches_executable_p  (bfd *core_bfd ATTRIBUTE_UNUSED,
> - bfd *exec_bfd ATTRIBUTE_UNUSED)
> -{
> -  /* FIXME, We have no way of telling at this point.  */
> -  return TRUE;
> -}
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  
> Index: osf-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/osf-core.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 osf-core.c
> --- osf-core.c 29 Oct 2005 23:00:12 -0000 1.15
> +++ osf-core.c 25 Nov 2005 02:40:19 -0000
> @@ -40,8 +40,7 @@ static char *osf_core_core_file_failing_
>    PARAMS ((bfd *));
>  static int osf_core_core_file_failing_signal
>    PARAMS ((bfd *));
> -static bfd_boolean osf_core_core_file_matches_executable_p
> -  PARAMS ((bfd *, bfd *));
> +#define osf_core_core_file_matches_executable_p generic_core_file_matches_executable_p
>  static void swap_abort
>    PARAMS ((void));
>  
> @@ -172,14 +171,6 @@ osf_core_core_file_failing_signal (abfd)
>  {
>    return core_signal (abfd);
>  }
> -
> -static bfd_boolean
> -osf_core_core_file_matches_executable_p (core_bfd, exec_bfd)
> -     bfd *core_bfd ATTRIBUTE_UNUSED;
> -     bfd *exec_bfd ATTRIBUTE_UNUSED;
> -{
> -  return TRUE; /* FIXME, We have no way of telling at this point */
> -}
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void
> Index: ptrace-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/ptrace-core.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 ptrace-core.c
> --- ptrace-core.c 4 May 2005 15:53:37 -0000 1.13
> +++ ptrace-core.c 25 Nov 2005 02:40:20 -0000
> @@ -51,8 +51,7 @@ struct trad_core_struct
>  const bfd_target *ptrace_unix_core_file_p PARAMS ((bfd *abfd));
>  char * ptrace_unix_core_file_failing_command PARAMS ((bfd *abfd));
>  int ptrace_unix_core_file_failing_signal PARAMS ((bfd *abfd));
> -bfd_boolean ptrace_unix_core_file_matches_executable_p
> -  PARAMS ((bfd *core_bfd, bfd *exec_bfd));
> +#define ptrace_unix_core_file_matches_executable_p generic_core_file_matches_executable_p
>  static void swap_abort PARAMS ((void));
>  
>  const bfd_target *
> @@ -151,15 +150,6 @@ ptrace_unix_core_file_failing_signal (ab
>  {
>    return abfd->tdata.trad_core_data->u.pt_sigframe.sig_num;
>  }
> -
> -bfd_boolean
> -ptrace_unix_core_file_matches_executable_p  (core_bfd, exec_bfd)
> -     bfd *core_bfd, *exec_bfd;
> -{
> -  /* FIXME: Use pt_timdat field of the ptrace_user structure to match
> -     the date of the executable */
> -  return TRUE;
> -}
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void
> Index: sco5-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/sco5-core.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 sco5-core.c
> --- sco5-core.c 29 Oct 2005 23:00:12 -0000 1.18
> +++ sco5-core.c 25 Nov 2005 02:40:21 -0000
> @@ -49,8 +49,7 @@ static struct user *read_uarea PARAMS ((
>  const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd));
>  char *sco5_core_file_failing_command PARAMS ((bfd *abfd));
>  int sco5_core_file_failing_signal PARAMS ((bfd *abfd));
> -bfd_boolean sco5_core_file_matches_executable_p
> -  PARAMS ((bfd *core_bfd, bfd *exec_bfd));
> +#define sco5_core_file_matches_executable_p generic_core_file_matches_executable_p
>  static void swap_abort PARAMS ((void));
>  
>  static asection *
> @@ -345,14 +344,6 @@ sco5_core_file_failing_signal (ignore_ab
>    : -1);
>  }
>  
> -bfd_boolean
> -sco5_core_file_matches_executable_p  (core_bfd, exec_bfd)
> -     bfd *core_bfd ATTRIBUTE_UNUSED;
> -     bfd *exec_bfd ATTRIBUTE_UNUSED;
> -{
> -  return TRUE; /* FIXME, We have no way of telling at this point */
> -}
> -
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void
>  swap_abort ()
> Index: trad-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/trad-core.c,v
> retrieving revision 1.22
> diff -u -p -r1.22 trad-core.c
> --- trad-core.c 27 Oct 2005 03:35:30 -0000 1.22
> +++ trad-core.c 25 Nov 2005 02:40:22 -0000
> @@ -65,8 +65,7 @@ struct trad_core_struct
>  const bfd_target *trad_unix_core_file_p PARAMS ((bfd *abfd));
>  char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd));
>  int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd));
> -bfd_boolean trad_unix_core_file_matches_executable_p
> -  PARAMS ((bfd *core_bfd, bfd *exec_bfd));
> +#define trad_unix_core_file_matches_executable_p generic_core_file_matches_executable_p
>  static void swap_abort PARAMS ((void));
>  
>  /* Handle 4.2-style (and perhaps also sysV-style) core dump file.  */
> @@ -253,14 +252,6 @@ trad_unix_core_file_failing_signal (igno
>    return -1; /* FIXME, where is it? */
>  #endif
>  }
> -
> -bfd_boolean
> -trad_unix_core_file_matches_executable_p  (core_bfd, exec_bfd)
> -     bfd *core_bfd ATTRIBUTE_UNUSED;
> -     bfd *exec_bfd ATTRIBUTE_UNUSED;
> -{
> -  return TRUE; /* FIXME, We have no way of telling at this point */
> -}
>  
>  /* If somebody calls any byte-swapping routines, shoot them.  */
>  static void


--
Joel
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Nick Clifton
Hi Joel,

>> 2005-11-17  Joel Brobecker  <[hidden email]>
>>
>>         * corefile.c (generic_core_file_matches_executable_p): New function.
>>         * libbfd-in.h (generic_core_file_matches_executable_p): Add
>>         declaration.
>>         * libbfd.h: Regenerate.
>>         * hpux-core.c: ANSIfy function declarations and prototypes.
>>         (thread_section_p): Manually expand bfd_section_name macro
>>         to make it clear that parameter ABFD is not used.
>>         (hpux_core_core_file_matches_executable_p): Delete, replaced
>>         by macro pointing to generic_core_file_matches_executable_p.
>>
>>         * aix386-core.c: Replace core_file_matches_executable_p null
>>         implementation by generic_core_file_matches_executable_p by
>>         using a macro.
>>         * aix5ppc-core.c: Likewise.
>>         * cisco-core.c: Likewise.
>>         * hppabsd-core.c: Likewise.
>>         * irix-core.c: Likewise.
>>         * lynx-core.c: Likewise.
>>         * mach-o.c: Likewise.
>>         * netbsd-core.c: Likewise.
>>         * osf-core.c: Likewise.
>>         * ptrace-core.c: Likewise.
>>         * sco5-core.c: Likewise.
>>         * trad-core.c: Likewise.

Approved - please apply.

Sorry for the delay in getting round to review this patch.  This is one
small formatting glitch:

    return (strcmp(exec, core) == 0);

Should be:

    return (strcmp (exec, core) == 0);

Personally I do not like extraneous parentheses in return statements
either, so this could also be:

    return strcmp (exec, core) == 0;

Cheers
   Nick
Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Joel Brobecker
> >>2005-11-17  Joel Brobecker  <[hidden email]>
> >>
> >>        * corefile.c (generic_core_file_matches_executable_p): New
> >>        function.
> >>        * libbfd-in.h (generic_core_file_matches_executable_p): Add
> >>        declaration.
> >>        * libbfd.h: Regenerate.
> >>        * hpux-core.c: ANSIfy function declarations and prototypes.
> >>        (thread_section_p): Manually expand bfd_section_name macro
> >>        to make it clear that parameter ABFD is not used.
> >>        (hpux_core_core_file_matches_executable_p): Delete, replaced
> >>        by macro pointing to generic_core_file_matches_executable_p.
> >>
> >>        * aix386-core.c: Replace core_file_matches_executable_p null
> >>        implementation by generic_core_file_matches_executable_p by
> >>        using a macro.
> >>        * aix5ppc-core.c: Likewise.
> >>        * cisco-core.c: Likewise.
> >>        * hppabsd-core.c: Likewise.
> >>        * irix-core.c: Likewise.
> >>        * lynx-core.c: Likewise.
> >>        * mach-o.c: Likewise.
> >>        * netbsd-core.c: Likewise.
> >>        * osf-core.c: Likewise.
> >>        * ptrace-core.c: Likewise.
> >>        * sco5-core.c: Likewise.
> >>        * trad-core.c: Likewise.
>
> Approved - please apply.

Thanks Nick. Checked in.

> Sorry for the delay in getting round to review this patch.

No worries, I have complaint. We're all busy.

> This is one
> small formatting glitch:
>
>    return (strcmp(exec, core) == 0);
>
> Should be:
>
>    return (strcmp (exec, core) == 0);
>
> Personally I do not like extraneous parentheses in return statements
> either, so this could also be:
>
>    return strcmp (exec, core) == 0;

I went for the latter. Sometimes, parens are useful to help GNU indent
find the proper indentation. But in this case, it's not warranted.
I still added them originally because I was concerned that there might
be a consistency rule regarding this.

Cheers,
--
Joel

Reply | Threaded
Open this post in threaded view
|

Re: [RFA/hpux] Implement file_matches_executable_p

Alan Modra
On Fri, Dec 23, 2005 at 02:22:43PM +0400, Joel Brobecker wrote:
> > >>2005-11-17  Joel Brobecker  <[hidden email]>
> > >>
> > >>        * corefile.c (generic_core_file_matches_executable_p): New
> > >>        function.
[snip]

Trying to build binutils with --enable-maintainer-mode fails since this
patch.  The "SYNOPSIS" keyword isn't there just for documentation;  It
causes the prototype to be copied to bfd-in2.h.  I guess this patch
wasn't tested with --enable-64-bit-bfd --enable-targets=all either, as
that would have shown an undefined symbol referenced from
coff64-rs6000.c.  Fixed like this:

        * aix5ppc-core.c: Remove duplicate prototypes.
        (xcoff64_core_file_matches_executable_p): Provide implementation
        for !AIX_5_CORE.
        * corefile.c (generic_core_file_matches_executable_p): Correct
        syntax error in prototype.
        * libbfd-in.h (generic_core_file_matches_executable_p): Delete.
        * libbfd.h: Regenerate.
        * bfd-in2.h: Regenerate.

Index: bfd/aix5ppc-core.c
===================================================================
RCS file: /cvs/src/src/bfd/aix5ppc-core.c,v
retrieving revision 1.13
diff -u -p -r1.13 aix5ppc-core.c
--- bfd/aix5ppc-core.c 23 Dec 2005 10:19:40 -0000 1.13
+++ bfd/aix5ppc-core.c 24 Dec 2005 07:23:19 -0000
@@ -23,16 +23,16 @@
 
 #include "bfd.h"
 
-#ifdef AIX_5_CORE
-
-#include "sysdep.h"
-#include "libbfd.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"
+
 /* Aix 5.1 system include file.  */
 
 /* Need to define this macro so struct ld_info64 get included.  */
@@ -318,11 +318,6 @@ xcoff64_core_file_failing_signal (bfd *a
 
 #else /* AIX_5_CORE */
 
-const bfd_target *xcoff64_core_p  (bfd *);
-#define xcoff64_core_file_matches_executable_p generic_core_file_matches_executable_p
-char *xcoff64_core_file_failing_command (bfd *);
-int xcoff64_core_file_failing_signal (bfd *);
-
 const bfd_target *
 xcoff64_core_p (bfd *abfd ATTRIBUTE_UNUSED)
 {
@@ -330,6 +325,12 @@ xcoff64_core_p (bfd *abfd ATTRIBUTE_UNUS
   return 0;
 }
 
+bfd_boolean
+xcoff64_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
+{
+  return generic_core_file_matches_executable_p (core_bfd, exec_bfd);
+}
+
 char *
 xcoff64_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED)
 {
Index: bfd/corefile.c
===================================================================
RCS file: /cvs/src/src/bfd/corefile.c,v
retrieving revision 1.11
diff -u -p -r1.11 corefile.c
--- bfd/corefile.c 23 Dec 2005 10:19:40 -0000 1.11
+++ bfd/corefile.c 24 Dec 2005 07:23:29 -0000
@@ -114,7 +114,7 @@ FUNCTION
 
 SYNOPSIS
         bfd_boolean generic_core_file_matches_executable_p
-          (bfd *core_bfd, bfd *exec_bfd)
+          (bfd *core_bfd, bfd *exec_bfd);
 
 DESCRIPTION
         Return TRUE if the core file attached to @var{core_bfd}
Index: bfd/libbfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/libbfd-in.h,v
retrieving revision 1.61
diff -u -p -r1.61 libbfd-in.h
--- bfd/libbfd-in.h 23 Dec 2005 10:19:40 -0000 1.61
+++ bfd/libbfd-in.h 24 Dec 2005 07:23:53 -0000
@@ -247,12 +247,6 @@ extern int _bfd_nocore_core_file_failing
 extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
   (bfd *, bfd *);
 
-/* A generic implementation of CORE_FILE_MATCHES_EXECUTABLE_P that
-   is independent of the target.  */
-
-extern bfd_boolean generic_core_file_matches_executable_p
-  (bfd *core_bfd, bfd *exec_bfd);
-
 /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
    file support.  Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive).  */
 
--
Alan Modra
IBM OzLabs - Linux Technology Centre