This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
default_no_named_section bad default
- From: Mike Stump <mikestump at comcast dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 May 2013 11:13:46 -0700
- Subject: default_no_named_section bad default
So, on darwin, the new tools don't like FDE information when you have:
__Z24default_no_named_sectionPKcjP9tree_node:
LFB588:
LFE588:
in the object file.
$ dwarfdump --eh-frame --verify varasm.o
----------------------------------------------------------------------
File: varasm.o (x86_64)
----------------------------------------------------------------------
Verifying EH Frame... error: FDE row for address 0x00000000000058f0 is not in the FDE address range.
0x000020e0: FDE
length: 0x0000001c
CIE_pointer: 0x00000000
start_addr: 0x00000000000058f0 __Z24default_no_named_sectionPKcjP9tree_node
range_size: 0x0000000000000000 (end_addr = 0x00000000000058f0)
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
Instructions: 0x00000000000058f0: CFA=rsp+8 rip=[rsp]
which, well, seems reasonable. This causes the static linker to reject it. Now, one can prune out the pair, but, I think really, we either need to have a default of 0 (to crash in a nice way), or an assert (to crash in a nice way). Just falling off then end into space (the next function in the executable file), seems wrong.
Ok?
PR57438
* varasm.c (default_no_named_section): Assert instead.
Index: varasm.c
===================================================================
--- varasm.c (revision 199270)
+++ varasm.c (working copy)
@@ -6052,7 +6052,7 @@ default_no_named_section (const char *na
{
/* Some object formats don't support named sections at all. The
front-end should already have flagged this as an error. */
- gcc_unreachable ();
+ gcc_assert (0);
}
#ifndef TLS_SECTION_ASM_FLAG