This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] mips: Allow larger values for __aligned__


On Sat, Oct 14, 2006 at 07:08:02AM +0200, Eric Botcazou wrote:
> > Ok. Could you explain why? I may still try to get this patch accepted in
> > stage 1, and I appreciate your comments.
> 
> Might be OK for stage 1, but I'm a big fan of minimalism when it comes to 
> paching compilers.

At the very minimum it should be the maximum supported by 32-bit ELF and
representable on a 32-bit host. This would meet the requirements of most
programs which need large aligments e.g. Linux Kernel. Changes to the
documentation will help future maintainers understand the rationale
behind the default.

Bootstrapped on x86_64-unknown-linux-gnu.

OK for mainline?

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi	(revision 119333)
+++ gcc/doc/tm.texi	(working copy)
@@ -1078,6 +1078,12 @@ Biggest alignment supported by the objec
 Use this macro to limit the alignment which can be specified using the
 @code{__attribute__ ((aligned (@var{n})))} construct.  If not defined,
 the default value is @code{BIGGEST_ALIGNMENT}.
+
+On systems that use ELF, the default (in @file{config/elfos.h}) is
+the largest supported 32-bit ELF section alignment representable on
+a 32-bit host e.g. @samp{(((unsigned HOST_WIDEST_INT) 1 << 28) * 8)}.
+On 32-bit ELF the largest supported section alignment in bits is
+@samp{(0x80000000 * 8)}, but this is not representable on 32-bit hosts.
 @end defmac
 
 @defmac DATA_ALIGNMENT (@var{type}, @var{basic-align})
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 119333)
+++ gcc/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2006-11-29  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* doc/tm.texi (MAX_OFILE_ALIGNMENT): Document default.
+	* config/elfos.h [!MAX_OFILE_ALIGNMENT] (MAX_OFILE_ALIGNMENT): 
+	Default is the largest alignment supported for 32-bit ELF and 
+	representable on a 32-bit host.
+
 2006-11-29  Janis Johnson  <janis187@us.ibm.com>
 
 	* config/dfp-bit.h (CONTEXT_ROUND): Delete.
Index: gcc/config/elfos.h
===================================================================
--- gcc/config/elfos.h	(revision 119333)
+++ gcc/config/elfos.h	(working copy)
@@ -40,12 +40,15 @@ Boston, MA 02110-1301, USA.  */
 #undef  USER_LABEL_PREFIX
 #define USER_LABEL_PREFIX ""
 
-/* Biggest alignment supported by the object file format of this
-   machine.  Use this macro to limit the alignment which can be
-   specified using the `__attribute__ ((aligned (N)))' construct.  If
-   not defined, the default value is `BIGGEST_ALIGNMENT'.  */
+/* The biggest alignment supported by ELF in bits. 32-bit ELF 
+   supports section alignment up to (0x80000000 * 8), while 
+   64-bit ELF supports (0x8000000000000000 * 8). If this macro 
+   is not defined, the default is the largest alignment supported 
+   by 32-bit ELF and representable on a 32-bit host. Use this
+   macro to limit the alignment which can be specified using
+   the `__attribute__ ((aligned (N)))' construct.  */
 #ifndef MAX_OFILE_ALIGNMENT
-#define MAX_OFILE_ALIGNMENT (32768 * 8)
+#define MAX_OFILE_ALIGNMENT (((unsigned int) 1 << 28) * 8)
 #endif
 
 /* Use periods rather than dollar signs in special g++ assembler names.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]