[PATCH] Ensure .rodata.cstNN sections have entries of size sh_entsize
Jakub Jelinek
jakub@redhat.com
Mon Nov 25 08:57:00 GMT 2002
Hi!
The following patch ensures padding of .rodata.cstNN sections to multiple
of sh_entsize bytes (== pool->align bits).
E.g. for IA-32 XFmode, pool->align is 128 while GET_MODE_BITSIZE(XFmode)
is 96, without this patch gcc emits:
.section .rodata.cst16
.LCN: .long W1, W2, W4
which means .rodata.cst16 section will not have sh_size multiple
of sh_entsize.
Ok to commit?
2002-11-25 Jakub Jelinek <jakub@redhat.com>
* varasm.c (output_constant_pool): For pool constants in mergeable
section ensure each constant is padded to multiple of entity size.
--- gcc/varasm.c.jj 2002-11-23 19:04:35.000000000 +0100
+++ gcc/varasm.c 2002-11-25 18:53:03.000000000 +0100
@@ -3499,6 +3499,13 @@ output_constant_pool (fnname, fndecl)
abort ();
}
+ /* Make sure all constants in SECTION_MERGE and not SECTION_STRINGS
+ sections have proper size. */
+ if (pool->align > GET_MODE_BITSIZE (pool->mode)
+ && in_section == in_named
+ && get_named_section_flags (in_named_name) & SECTION_MERGE)
+ assemble_align (pool->align);
+
#ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY
done: ;
#endif
Jakub
More information about the Gcc-patches
mailing list