bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sparc-lp64: stab section entsize wrong


From: Alan Modra
Subject: Re: sparc-lp64: stab section entsize wrong
Date: Mon, 1 Jul 2002 23:14:30 +0930
User-agent: Mutt/1.3.25i

On Thu, Jun 27, 2002 at 03:15:22PM -0700, Marco Walther wrote:
> Hi,
> 
> the subject says it all.  Gas out of binutils-2.12.1 produces an
> sh_entsize of 0x14 for the .stab section when building a 64bit object.
> But the stab entries are still 12 (0x0c) bytes long even for 64bit
> objects.

> --- binutils-2.12.1/bfd/elf.c.orig    Thu May  9 07:48:54 2002
> +++ binutils-2.12.1/bfd/elf.c Thu Jun 27 15:07:44 2002
> @@ -2547,8 +2547,17 @@
>                 elf_section_data (s)->this_hdr.sh_link = d->this_idx;
>  
>                 /* This is a .stab section.  */
> -               elf_section_data (s)->this_hdr.sh_entsize =
> -                 4 + 2 * bfd_get_arch_size (abfd) / 8;
> +               if (bfd_mach_sparc_v9_p(bfd_get_arch(abfd)))

This is very broken.  Also, it is better to keep arch specific code
out of the generic code.

An acceptable fix might be to modify the code you're patching above to
only set sh_entsize if zero (I think it defaults to zero, not sure),
and set up the sparc sh_entsize value in a new
elf_backend_fake_sections function living in elf64-sparc.c.

> +                 {
> +                             /* MARCO: stabs are always 12bytes
> +                                long for now. */
> +                   elf_section_data (s)->this_hdr.sh_entsize = 12;
> +                 }
> +               else
> +                 {
> +                   elf_section_data (s)->this_hdr.sh_entsize =
> +                     4 + 2 * bfd_get_arch_size (abfd) / 8;
> +                 }
>               }
>           }
>         break;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



reply via email to

[Prev in Thread] Current Thread [Next in Thread]