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: PR ld/15141: Linker (ld.bfd) option "--trace-symbol" does not work with LTO


On Fri, Feb 15, 2013 at 11:23 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> This patch also traces symbol from the IR bfd.  OK to install?
>
> Thanks.
>
>
> H.J.
> ---
> 2013-02-15  H.J. Lu  <hongjiu.lu@intel.com>
>
>         PR ld/15141
>         * plugin.c (plugin_notice): Also trace symbol from the IR bfd.
>
> diff --git a/ld/plugin.c b/ld/plugin.c
> index da99e77..04c8dbe 100644
> --- a/ld/plugin.c
> +++ b/ld/plugin.c
> @@ -964,7 +964,7 @@ plugin_notice (struct bfd_link_info *info,
>
>        /* No further processing if this def/ref is from an IR dummy BFD.  */
>        if (is_ir_dummy_bfd (abfd))
> -       return TRUE;
> +       goto trace_symbol;
>
>        /* Making an indirect symbol counts as a reference unless this
>          is a brand new symbol.  */
> @@ -1012,6 +1012,7 @@ plugin_notice (struct bfd_link_info *info,
>         }
>      }
>
> +trace_symbol:
>    /* Continue with cref/nocrossref/trace-sym processing.  */
>    if (h == NULL
>        || orig_notice_all

Slightly better patch.


-- 
H.J.
----
2013-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/15141
	* plugin.c (plugin_notice): Also trace symbol from the IR bfd.

diff --git a/ld/plugin.c b/ld/plugin.c
index da99e77..435f466 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -962,14 +962,14 @@ plugin_notice (struct bfd_link_info *info,
     {
       bfd *sym_bfd;

-      /* No further processing if this def/ref is from an IR dummy BFD.  */
+      /* Nothing to do here if this def/ref is from an IR dummy BFD.  */
       if (is_ir_dummy_bfd (abfd))
-	return TRUE;
+	;

       /* Making an indirect symbol counts as a reference unless this
 	 is a brand new symbol.  */
-      if (bfd_is_ind_section (section)
-	  || (flags & BSF_INDIRECT) != 0)
+      else if (bfd_is_ind_section (section)
+	       || (flags & BSF_INDIRECT) != 0)
 	{
 	  if (h->type != bfd_link_hash_new)
 	    {


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