Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Fergal Daly <fergal@esatclear.ie>, binutils@sources.redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] prevent core dump for multiple def symbols
Date: Fri, 11 Jun 2004 14:53:00 -0000	[thread overview]
Message-ID: <20040611145341.GA24143@nevyn.them.org> (raw)
In-Reply-To: <20040611144526.GF16613@dyn.fergaldaly.com>

The files in bfd/ are maintained as part of GNU Binutils, so you need
to ask on the binutils list about this patch.

It seems obvious and correct to me.  Is multiple_definition a recent
callback or did I just miss it when I wrote simple.c?  [I won't even
ask how you have a shared library with multiple definitions of a
dynamic symbol.]

On Fri, Jun 11, 2004 at 03:45:26PM +0100, Fergal Daly wrote:
> I have a .so file that makes gdb dump core. The problem shows up in
> bfd/linker.c:1800
> 
> if (! ((*info->callbacks->multiple_definition)
>   (info, h->root.string, msec->owner, msec, mval,
>   abfd, section, value)))
>     return FALSE;
> 
> because info->callbacks->multiple_definition is null.
> 
> I have no idea if this patch is "the right thing" but it allows me to debug
> my app. It just sets the callback to a dummy callback which returns TRUE
> when the link_info is being created. I presume this is OK because all the
> other callbacks are set to dummies too.
> 
> This was logged as bug 1668, hopefully this is a fix for it.
> 
> Patch below,
> 
> F
> 
> 
> --- ./bfd/simple.c.orig	2004-06-11 15:32:40.620497552 +0100
> +++ ./bfd/simple.c	2004-06-11 15:18:42.043980560 +0100
> @@ -78,6 +78,19 @@
>    return TRUE;
>  }
>  
> +static bfd_boolean
> +simple_dummy_multiple_definition (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
> +			       const char *name ATTRIBUTE_UNUSED,
> +			       bfd *obfd ATTRIBUTE_UNUSED,
> +			       asection *osec,
> +			       bfd_vma oval ATTRIBUTE_UNUSED,
> +			       bfd *nbfd ATTRIBUTE_UNUSED,
> +			       asection *nsec ATTRIBUTE_UNUSED,
> +			       bfd_vma nval ATTRIBUTE_UNUSED)
> +{
> +  return TRUE;
> +}
> +
>  struct saved_output_info
>  {
>    bfd_vma offset;
> @@ -171,6 +184,7 @@
>    callbacks.reloc_overflow = simple_dummy_reloc_overflow;
>    callbacks.reloc_dangerous = simple_dummy_reloc_dangerous;
>    callbacks.unattached_reloc = simple_dummy_unattached_reloc;
> +  callbacks.multiple_definition = simple_dummy_multiple_definition;
>  
>    memset (&link_order, 0, sizeof (link_order));
>    link_order.next = NULL;
> 

-- 
Daniel Jacobowitz


  reply	other threads:[~2004-06-11 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11 14:45 Fergal Daly
2004-06-11 14:53 ` Daniel Jacobowitz [this message]
2004-06-11 15:12   ` Fergal Daly
2004-06-11 15:39   ` Ian Lance Taylor
2004-06-11 16:05     ` Fergal Daly
2004-12-07  4:40   ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040611145341.GA24143@nevyn.them.org \
    --to=drow@false.org \
    --cc=binutils@sources.redhat.com \
    --cc=fergal@esatclear.ie \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox