This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix glitch with DW_AT_MIPS_linkage_name
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 6 Jun 2010 19:27:08 +0200
- Subject: Re: [patch] Fix glitch with DW_AT_MIPS_linkage_name
- References: <201006061910.17628.ebotcazou@adacore.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Jun 06, 2010 at 07:10:17PM +0200, Eric Botcazou wrote:
> Tested on i586-suse-linux, OK for mainline?
>
>
> 2010-06-06 Eric Botcazou <ebotcazou@adacore.com>
>
> * dwarf2out.c (add_name_and_src_coords_attributes): Skip a leading '*'
> in the DW_AT_MIPS_linkage_name.
>
>
> --
> Eric Botcazou
> Index: dwarf2out.c
> ===================================================================
> --- dwarf2out.c (revision 160335)
> +++ dwarf2out.c (working copy)
> @@ -17211,8 +17211,14 @@ add_name_and_src_coords_attributes (dw_d
> deferred_asm_name = asm_name;
> }
> else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
> - add_AT_string (die, AT_linkage_name,
^^^
> - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
> + {
> + const char *name
> + = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
> + /* Mimic what assemble_name_raw does with a leading '*'. */
> + if (name[0] == '*')
> + name = &name[1];
> + add_AT_string (die, DW_AT_MIPS_linkage_name, name);
^^^^^^
This is not ok, you've reverted a DWARF4 support change.
You want to use AT_linkage_name as second argument to add_AT_string.
Jakub