64k pages problem

Alan Modra amodra@bigpond.net.au
Thu Dec 2 09:38:00 GMT 2004


On Thu, Dec 02, 2004 at 05:46:02PM +1100, Benjamin Herrenschmidt wrote:
> Currently, gas won't let us use align on more than 15 bits, taht
> is .align 15 is the max and .balign 32K is the max. That causes all
> sorts of trouble when trying to go to 64k pages.

This has come up before, and I seem to recall someone stating that
there isn't any real reason for the 15 bit limit.

	* read.c (ALIGN_LIMIT): Define, increasing limit for BFD_ASSEMBLER.
	(s_align): Use it.

Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.81
diff -u -p -r1.81 read.c
--- gas/read.c	22 Nov 2004 13:05:26 -0000	1.81
+++ gas/read.c	2 Dec 2004 09:13:47 -0000
@@ -1195,10 +1195,16 @@ do_align (int n, char *fill, int len, in
    fill pattern.  BYTES_P is non-zero if the alignment value should be
    interpreted as the byte boundary, rather than the power of 2.  */
 
+#ifdef BFD_ASSEMBLER
+#define ALIGN_LIMIT (stdoutput->arch_info->bits_per_address - 1)
+#else
+#define ALIGN_LIMIT 15
+#endif
+
 static void
 s_align (int arg, int bytes_p)
 {
-  register unsigned int align;
+  unsigned int align;
   char *stop = NULL;
   char stopc;
   offsetT fill = 0;
@@ -1237,9 +1243,9 @@ s_align (int arg, int bytes_p)
 	}
     }
 
-  if (align > 15)
+  if (align > ALIGN_LIMIT)
     {
-      align = 15;
+      align = ALIGN_LIMIT;
       as_warn (_("alignment too large: %u assumed"), align);
     }
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list