Hello Alan,

thanks for looking at this issue.

On 10/24/2012 04:50 PM, Alan Modra wrote:
On Tue, Oct 23, 2012 at 06:25:43PM +0200, Sebastian Huber wrote:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55033

This patch fixes my problem, but I am absolutely not sure if this is the
right way.
[snip]

This is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9571 all over again.

IMHO your patch is not wrong, but a better idea is that if we've used
categorize_decl_for_section to choose a section name, then we ought to
also use categorize_decl_for_section to choose section flags.

Yes, I thought about this too, but I know to little about GCC to do this on my 
own.


My original fix for pr9571 was to pass the decl down to
get_named_section.
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02487.html
That hit the assert in get_named_section when building libgfortran for
ia64, and my knee-jerk patch to fix that was to simply satisfy the
assert.  After looking at all the target section_type_flags functions,
I believe the following is what I should have done way back then.
Bootstrapped and regression tested powerpc64-linux.

        * varasm.c (default_elf_select_section): Move !DECL_P check..
        (get_named_section): ..to here before calling get_section_name.
        Adjust assertion.
        (default_section_type_flags): Add DECL_P check.
        * config/i386/winnt.c (i386_pe_section_type_flags): Likewise.
        * config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags): Likewise.

Your change fixes the problem in PR55033. I can also run the RTEMS test suite with it, so from my point of view this looks perfect.

--
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


Reply via email to