This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Define MAX_OFILE_ALIGNMENT for Tru64 UNIX
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 06 Apr 2011 10:46:12 +0200
- Subject: Define MAX_OFILE_ALIGNMENT for Tru64 UNIX
The recent failure of
FAIL: gcc.dg/torture/pr47975.c -O0 (test for excess errors)
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/torture/pr47975.c:4:40: warning: alignment of 'x' is greater than maximum object file alignment. Using 16 [enabled by default]
prompted me to finally look at the alignment requirements of Alpha
ECOFF. Currently, MAX_OFILE_ALIGNMENT isn't defined, so it defaults to
BIGGEST_ALIGNMENT, i.e. 16 bytes. But the Tru64 UNIX Object File and
Symbol Table Format Specification document a maximum alignment of 64 kB:
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/SUPPDOCS/OBJSPEC/NV20XXXX.HTM#nav2-29
The following patch implements this and fixes not only the testcase
above, but a considerable number of others.
Bootstrapped without regression on alpha-dec-osf5.1b, installed on
mainline. Will backport to the 4.5 and 4.6 branches.
Rainer
2011-03-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/alpha/osf5.h (MAX_OFILE_ALIGNMENT): Define.
diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h
--- a/gcc/config/alpha/osf5.h
+++ b/gcc/config/alpha/osf5.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler, for DEC Alpha on
Tru64 UNIX V5.1.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
+ 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -223,6 +223,10 @@ __enable_execute_stack (void *addr)
#define LD_INIT_SWITCH "-init"
#define LD_FINI_SWITCH "-fini"
+/* From Tru64 UNIX Object File and Symbol Table Format Specification,
+ 2.3.5 Alignment, p.19. */
+#define MAX_OFILE_ALIGNMENT (64 * 1024 * BITS_PER_UNIT)
+
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University