This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Ensure .rodata.cstNN sections have entries of size sh_entsize
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, Ulrich Drepper <drepper at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Nov 2002 17:57:39 +0100
- Subject: [PATCH] Ensure .rodata.cstNN sections have entries of size sh_entsize
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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