]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Support target specific ALIGN for variable alignment test [BZ #28676]
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 10 Dec 2021 23:44:46 +0000 (15:44 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 14 Dec 2021 22:50:33 +0000 (14:50 -0800)
Add <tst-file-align.h> to support target specific ALIGN for variable
alignment test:

1. Alpha: Use 0x10000.
2. MicroBlaze and Nios II: Use 0x8000.
3. All others: Use 0x200000.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
elf/tst-align3.c
elf/tst-alignmod3.c
sysdeps/alpha/tst-file-align.h [new file with mode: 0644]
sysdeps/generic/tst-file-align.h [new file with mode: 0644]
sysdeps/microblaze/tst-file-align.h [new file with mode: 0644]
sysdeps/nios2/tst-file-align.h [new file with mode: 0644]

index ac86d623a62f9e0f43da857c6845e853e8800570..87a8ff81a0b6dd4a95e7cc9689f7e726f3553cee 100644 (file)
    <https://www.gnu.org/licenses/>.  */
 
 #include <support/check.h>
+#include <tst-file-align.h>
 #include <tst-stack-align.h>
 
-/* This should cover all possible page sizes we currently support.  */
-#define ALIGN 0x200000
-
 int bar __attribute__ ((aligned (ALIGN))) = 1;
 
 extern int do_load_test (void);
index 0d33f2379d1c04aa896d9b45a0e412f1d0994b12..9520c35220089b498108265a9fe3420dc31f4ebd 100644 (file)
    <https://www.gnu.org/licenses/>.  */
 
 #include <support/check.h>
+#include <tst-file-align.h>
 #include <tst-stack-align.h>
 
-/* This should cover all possible page sizes we currently support.  */
-#define ALIGN 0x200000
-
 int foo __attribute__ ((aligned (ALIGN))) = 1;
 
 void
diff --git a/sysdeps/alpha/tst-file-align.h b/sysdeps/alpha/tst-file-align.h
new file mode 100644 (file)
index 0000000..8fc3c94
--- /dev/null
@@ -0,0 +1,20 @@
+/* Check file alignment.  Alpha version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This should cover all possible alignments we currently support.  */
+#define ALIGN 0x10000
diff --git a/sysdeps/generic/tst-file-align.h b/sysdeps/generic/tst-file-align.h
new file mode 100644 (file)
index 0000000..6ee6783
--- /dev/null
@@ -0,0 +1,20 @@
+/* Check file alignment.  Generic version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This should cover all possible page sizes we currently support.  */
+#define ALIGN 0x200000
diff --git a/sysdeps/microblaze/tst-file-align.h b/sysdeps/microblaze/tst-file-align.h
new file mode 100644 (file)
index 0000000..43c58b2
--- /dev/null
@@ -0,0 +1,20 @@
+/* Check file alignment.  MicroBlaze version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This should cover all possible alignments we currently support.  */
+#define ALIGN 0x8000
diff --git a/sysdeps/nios2/tst-file-align.h b/sysdeps/nios2/tst-file-align.h
new file mode 100644 (file)
index 0000000..589a2d5
--- /dev/null
@@ -0,0 +1,20 @@
+/* Check file alignment.  Nios II version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This should cover all possible alignments we currently support.  */
+#define ALIGN 0x8000