This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Pass SECTION_LINKONCE to named_section_flags
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Apr 2005 14:04:35 -0700
- Subject: PATCH: Pass SECTION_LINKONCE to named_section_flags
output_comp_unit may call named_section_flags with a linkonce section
name, but without passing SECTION_LINKONCE. As the result, comdat
group won't be used for .gnu.linkonce.wi.* sections. This patch makes
sure that SECTION_LINKONCE is passed to named_section_flags with
.gnu.linkonce.wi.* sections.
H.J.
---
2005-04-06 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2out.c (output_comp_unit): Pass SECTION_LINKONCE to
named_section_flags when needed.
--- dwarf2out.c.normal 2005-04-04 13:28:54.000000000 -0700
+++ dwarf2out.c 2005-04-06 13:42:13.552167331 -0700
@@ -7030,6 +7030,7 @@ static void
output_comp_unit (dw_die_ref die, int output_if_empty)
{
const char *secname;
+ unsigned int flags;
char *oldsym, *tmp;
/* Unless we are outputting main CU, we may throw away empty ones. */
@@ -7049,6 +7050,8 @@ output_comp_unit (dw_die_ref die, int ou
next_die_offset = DWARF_COMPILE_UNIT_HEADER_SIZE;
calc_die_sizes (die);
+ flags = SECTION_DEBUG;
+
oldsym = die->die_symbol;
if (oldsym)
{
@@ -7056,13 +7059,14 @@ output_comp_unit (dw_die_ref die, int ou
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
+ flags |= SECTION_LINKONCE;
die->die_symbol = NULL;
}
else
secname = (const char *) DEBUG_INFO_SECTION;
/* Output debugging information. */
- named_section_flags (secname, SECTION_DEBUG);
+ named_section_flags (secname, flags);
output_compilation_unit_header ();
output_die (die);