unsigned HOST_WIDE_INT size,
unsigned int l2align)
{
- /* FIXME: We have a fudge to make this work with Java even when the target does
- not use sections anchors -- Java seems to need at least one small item in a
- non-zerofill segment. */
- if ((DARWIN_SECTION_ANCHORS && flag_section_anchors && size < BYTES_ZFILL)
- || (size && size <= 2))
+ if (DARWIN_SECTION_ANCHORS && flag_section_anchors && size < BYTES_ZFILL)
{
/* Put smaller objects in _static_data, where the section anchors system
can get them.
}
else
{
- /* When we are on a non-section anchor target, we can get zero-sized
- items here. However, all we need to do is to bump them to one byte
- and the section alignment will take care of the rest. */
+ /* When we are on a non-section anchor target (or not using section
+ anchors, we can get zero-sized items here. However, all we need to
+ do is to bump them to one byte and the section alignment will take
+ care of the rest. */
char secnam[64];
- unsigned int flags ;
- snprintf (secnam, 64, "__DATA,__%sbss%u", ((size)?"":"zo_"),
- (unsigned) l2align);
- /* We can't anchor (yet, if ever) in zerofill sections, because we can't
- switch to them and emit a label. */
- flags = SECTION_BSS|SECTION_WRITE|SECTION_NO_ANCHOR;
+ snprintf (secnam, 64, "__DATA,__bss");
+ unsigned int flags = SECTION_BSS|SECTION_WRITE|SECTION_NO_ANCHOR;
in_section = get_section (secnam, flags, NULL);
fprintf (fp, "\t.zerofill %s,", secnam);
assemble_name (fp, name);
fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",
size, (unsigned) l2align);
else
- fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", size);
+ fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED",0\n", size);
}
(*targetm.encode_section_info) (decl, DECL_RTL (decl), false);
return;
}
- /* So we have a public symbol (small item fudge for Java, see above). */
- if ((DARWIN_SECTION_ANCHORS && flag_section_anchors && size < BYTES_ZFILL)
- || (size && size <= 2))
+ /* So we have a public symbol. */
+ if (DARWIN_SECTION_ANCHORS && flag_section_anchors && size < BYTES_ZFILL)
{
/* Put smaller objects in data, where the section anchors system can get
them. However, if they are zero-sized punt them to yet a different
}
else
{
+ /* Section anchors not in use. */
+ unsigned int flags = SECTION_BSS|SECTION_WRITE|SECTION_NO_ANCHOR;
char secnam[64];
- unsigned int flags ;
- /* When we are on a non-section anchor target, we can get zero-sized
- items here. However, all we need to do is to bump them to one byte
- and the section alignment will take care of the rest. */
- snprintf (secnam, 64, "__DATA,__%spu_bss%u", ((size)?"":"zo_"), l2align);
-
- /* We can't anchor in zerofill sections, because we can't switch
- to them and emit a label. */
- flags = SECTION_BSS|SECTION_WRITE|SECTION_NO_ANCHOR;
+ snprintf (secnam, 64, "__DATA,__common");
in_section = get_section (secnam, flags, NULL);
fprintf (fp, "\t.zerofill %s,", secnam);
assemble_name (fp, name);
if (l2align)
fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", size, l2align);
else
- fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", size);
+ fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED",0\n", size);
}
(* targetm.encode_section_info) (decl, DECL_RTL (decl), false);
}
/* { dg-final { scan-assembler ".comm\[\t \]_ub,1" } } */
/* { dg-final { scan-assembler ".comm\[\t \]_ea,1" } } */
-/* These should go into .data */
+/* These should go into __DATA,__common */
char a = 0;
short b = 0;
-/* { dg-final { scan-assembler ".globl _a.*.data.*.space\[\t \]1" } } */
-/* { dg-final { scan-assembler ".globl _b.*.data.*.space\[\t \]2" } } */
-
-/* These should go into __pu_bssN */
long long d = 0;
float e = 0;
double f = 0;
long double g = 0.L;
long long al_256 __attribute__((aligned (256))) = 0;
-/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss3,_d,8,3" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss2,_e,4,2" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss3,_f,8,3" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss4,_g,16,4" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss8,_al_256,8,8" } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_a,1,0} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_b,2,1} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_d,8,3} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_e,4,2} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_f,8,3} } } */
+/* long double can be 64 or 128 bits depending on the Darwin subtarget. */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_g,(16,4|8,3)} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__common,_al_256,8,8} } } */
-/* This should go into __zo_bss0 */
+/* These should go into __DATA,__bss */
static e_s sea;
-/* { dg-final { scan-assembler ".zerofill __DATA,__zo_bss0,_sea,1" } } */
-
-/* These should go into .static_data */
static char sa ;
static short sb ;
-/* { dg-final { scan-assembler ".static_data.*_sa:.*.space\[\t \]1" } } */
-/* { dg-final { scan-assembler ".static_data.*_sb:.*.space\[\t \]2" } } */
-
-/* These should go into _bssN */
static long long sd;
static float se ;
static double sf ;
static long double sg;
static long long sal_256 __attribute__((aligned (2048)));
-/* { dg-final { scan-assembler ".zerofill __DATA,__bss3,_sd,8,3" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__bss2,_se,4,2" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__bss3,_sf,8,3" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__bss4,_sg,16,4" } } */
-/* { dg-final { scan-assembler ".zerofill __DATA,__bss11,_sal_256,8,11" } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sea,1,0} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sa,1,0} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sb,2,1} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sd,8,3} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_se,4,2} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sf,8,3} } } */
+/* long double can be 64 or 128 bits depending on the Darwin subtarget. */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sg,(16,4|8,3)} } } */
+/* { dg-final { scan-assembler {.zerofill __DATA,__bss,_sal_256,8,11} } } */
long long foo (int x)
{