This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Increase maximum alignment for MIPS.
- From: Carlos O'Donell <carlos at codesourcery dot com>
- To: binutils at sourceware dot org
- Date: Mon, 24 Sep 2007 12:41:21 -0400
- Subject: [PATCH] Increase maximum alignment for MIPS.
The following patch increases the maximum MIPS aligmnet to match the
changes in GCC for MAX_OFILE_ALIGNMENT. This allows you to assemble
files compiled with "__attribute__((__aligned__(X)))" where X may be
larger than 2^15.
I tried to make sure the testcase would also work for 32-bit targets.
Tested on mips64el-none-linux-gnu without regressions.
OK to checkin?
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716
2007-09-24 Carlos O'Donell <carlos@codesourcery.com>
* config/tc-mips.c (s_align): Set max_alignment to 28.
diff -urN binutils-head-orig/gas/config/tc-mips.c binutils-head/gas/config/tc-mips.c
--- binutils-head-orig/gas/config/tc-mips.c 2007-09-24 09:31:07.000000000 -0700
+++ binutils-head/gas/config/tc-mips.c 2007-09-24 09:31:33.000000000 -0700
@@ -12047,7 +12047,7 @@
{
int temp;
long temp_fill;
- long max_alignment = 15;
+ long max_alignment = 28;
/* o Note that the assembler pulls down any immediately preceding label
to the aligned address.
2007-09-24 Carlos O'Donell <carlos@codesourcery.com>
* gas/mips/align.s, gas/mips/align.d: New test.
* gas/mips/mips.exp: Run it.
diff -urN binutils-head-orig/gas/testsuite/gas/mips/align.d binutils-head/gas/testsuite/gas/mips/align.d
--- binutils-head-orig/gas/testsuite/gas/mips/align.d 1969-12-31 16:00:00.000000000 -0800
+++ binutils-head/gas/testsuite/gas/mips/align.d 2007-09-24 09:31:50.000000000 -0700
@@ -0,0 +1,14 @@
+#objdump: -dr
+#name: MIPS align maximum
+
+# Test the align macro at maximum alignment.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+
+[0]*00000000 <foo>:
+ ...
+
+[0]*10000000 <bar>:
+ ...
diff -urN binutils-head-orig/gas/testsuite/gas/mips/align.s binutils-head/gas/testsuite/gas/mips/align.s
--- binutils-head-orig/gas/testsuite/gas/mips/align.s 1969-12-31 16:00:00.000000000 -0800
+++ binutils-head/gas/testsuite/gas/mips/align.s 2007-09-24 09:31:50.000000000 -0700
@@ -0,0 +1,7 @@
+# Test file used to verify maximum alignment value.
+foo:
+ nop
+
+ .align 28
+bar:
+ nop
diff -urN binutils-head-orig/gas/testsuite/gas/mips/mips.exp binutils-head/gas/testsuite/gas/mips/mips.exp
--- binutils-head-orig/gas/testsuite/gas/mips/mips.exp 2007-09-24 09:31:08.000000000 -0700
+++ binutils-head/gas/testsuite/gas/mips/mips.exp 2007-09-24 09:31:33.000000000 -0700
@@ -774,4 +774,5 @@
run_dump_test "vxworks1-xgot-el"
run_dump_test "noreorder"
+ run_dump_test "align"
}