aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index ba866ce..72cba86 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6256,6 +6256,7 @@ default_elf_asm_named_section (const char *name, unsigned int flags,
tree decl)
{
char flagchars[11], *f = flagchars;
+ unsigned int numeric_value = 0;
/* If we have already declared this section, we can use an
abbreviated form to switch back to it -- unless this section is
@@ -6268,31 +6269,38 @@ default_elf_asm_named_section (const char *name, unsigned int flags,
return;
}
- if (!(flags & SECTION_DEBUG))
- *f++ = 'a';
+ /* If we have a machine specific flag, then use the numeric value to pass
+ this on to GAS. */
+ if (targetm.asm_out.elf_flags_numeric (flags, &numeric_value))
+ snprintf (f, sizeof (flagchars), "0x%08x", numeric_value);
+ else
+ {
+ if (!(flags & SECTION_DEBUG))
+ *f++ = 'a';
#if defined (HAVE_GAS_SECTION_EXCLUDE) && HAVE_GAS_SECTION_EXCLUDE == 1
- if (flags & SECTION_EXCLUDE)
- *f++ = 'e';
+ if (flags & SECTION_EXCLUDE)
+ *f++ = 'e';
#endif
- if (flags & SECTION_WRITE)
- *f++ = 'w';
- if (flags & SECTION_CODE)
- *f++ = 'x';
- if (flags & SECTION_SMALL)
- *f++ = 's';
- if (flags & SECTION_MERGE)
- *f++ = 'M';
- if (flags & SECTION_STRINGS)
- *f++ = 'S';
- if (flags & SECTION_TLS)
- *f++ = TLS_SECTION_ASM_FLAG;
- if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE))
- *f++ = 'G';
+ if (flags & SECTION_WRITE)
+ *f++ = 'w';
+ if (flags & SECTION_CODE)
+ *f++ = 'x';
+ if (flags & SECTION_SMALL)
+ *f++ = 's';
+ if (flags & SECTION_MERGE)
+ *f++ = 'M';
+ if (flags & SECTION_STRINGS)
+ *f++ = 'S';
+ if (flags & SECTION_TLS)
+ *f++ = TLS_SECTION_ASM_FLAG;
+ if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE))
+ *f++ = 'G';
#ifdef MACH_DEP_SECTION_ASM_FLAG
- if (flags & SECTION_MACH_DEP)
- *f++ = MACH_DEP_SECTION_ASM_FLAG;
+ if (flags & SECTION_MACH_DEP)
+ *f++ = MACH_DEP_SECTION_ASM_FLAG;
#endif
- *f = '\0';
+ *f = '\0';
+ }
fprintf (asm_out_file, "\t.section\t%s,\"%s\"", name, flagchars);