[PATCH] PR46667, fix section type conflicts
Chung-Lin Tang
cltang@codesourcery.com
Thu Dec 2 09:06:00 GMT 2010
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.".
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: varasm.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101202/850cc1b0/attachment.txt>
More information about the Gcc-patches
mailing list