This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH] PR46667, fix section type conflicts


Hi,
this patch tries to fix the section type conflicts seen on ARM-Linux (which currently prevents libstdc++ from building on trunk) and the reported x86-64 fails when -freorder-blocks-and-partition is involved.


The ARM fails seem to be due to DECL_ONE_ONLY symbols being treated as added to the .text.unlikely section; I've added a call to resolve_unique_section() to fill in the DECL_SECTION_NAME and DECL_HAS_IMPLICIT_SECTION_NAME_P values as I see are needed.

The x86-64 failure seems to be calling get_named_section() during dwarf2out_init(), when current_function_decl is still NULL, with the resulting section flags containing SECTION_WRITE. I've added an additional condition testing the ".text." section name prefix when decl is NULL.

This patch has been tested on the respective platforms with no regressions, and does now revive the ARM-Linux C++ build; however, I'm not sure whether this is a robust enough fix; it may just well be band-aid :P

Thanks,
Chung-Lin

2010-12-02 Chung-Lin Tang <cltang@codesourcery.com>

        PR middle-end/46667
        * varasm.c (get_named_section): Add call to
	resolve_unique_section().
        (default_function_section): Call get_named_section() for
        DECL_ONE_ONLY decls.
        (default_section_type_flags): Start off with SECTION_CODE as
	flags value when decl is NULL and section name starts with
	".text.".

Attachment: varasm.diff.txt
Description: Text document


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