On Fri, Aug 23, 2013 at 9:08 AM, Jakub Jelinek <ja...@redhat.com> wrote:

> On the following testcase we generate
> .section        .lbss,"aw",@progbits
> which causes assembler warning, it is supposed to be
> .section        .lbss,"aw",@nobits
> instead.  The following patch fixes that.  I went through all of
> default_section_type_flags and looked for which sections the default
> decision is based on section name and which sections have large data
> counterparts on x86-64 and I hope I've caught up all of them.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.8?
>
> 2013-08-23  Jakub Jelinek  <ja...@redhat.com>
>
>         PR target/58218
>         * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define.
>         * config/i386/i386.c (x86_64_elf_section_type_flags): New function.
>
>         * gcc.target/i386/pr58218.c: New test.
>
> --- gcc/config/i386/x86-64.h.jj 2013-04-25 23:47:56.000000000 +0200
> +++ gcc/config/i386/x86-64.h    2013-08-22 20:15:12.197344591 +0200
> @@ -103,3 +103,6 @@ see the files COPYING3 and COPYING.RUNTI
>
>  #undef TARGET_ASM_UNIQUE_SECTION
>  #define TARGET_ASM_UNIQUE_SECTION  x86_64_elf_unique_section
> +
> +#undef TARGET_SECTION_TYPE_FLAGS
> +#define TARGET_SECTION_TYPE_FLAGS  x86_64_elf_section_type_flags
> --- gcc/config/i386/i386.c.jj   2013-08-22 20:30:09.206333231 +0200
> +++ gcc/config/i386/i386.c      2013-08-22 22:25:53.249919215 +0200
> @@ -4912,6 +4912,31 @@ x86_64_elf_select_section (tree decl, in
>    return default_elf_select_section (decl, reloc, align);
>  }
>
> +/* Select a set of attributes for section NAME based on the properties
> +   of DECL and whether or not RELOC indicates that DECL's initializer
> +   might contain runtime relocations.  */
> +
> +static unsigned int x86_64_elf_section_type_flags (tree, const char *, int)
> +       ATTRIBUTE_UNUSED;
> +
> +static unsigned int
> +x86_64_elf_section_type_flags (tree decl, const char *name, int reloc)

Could we avoid prototype with:

static unsigned int ATTRIBUTE_UNUSED
x86_64_elf_section_type_flags ( ... )

?

The patch is OK with or without this change. We already have a mixture
of declarations there...

Thanks,
Uros.

Reply via email to