* [PATCH v3] Support target specific ALIGN for variable alignment test [BZ #28676]
@ 2021-12-10 23:53 H.J. Lu
2021-12-14 22:15 ` Adhemerval Zanella
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2021-12-10 23:53 UTC (permalink / raw)
To: libc-alpha
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.
---
elf/tst-align3.c | 4 +---
elf/tst-alignmod3.c | 4 +---
sysdeps/alpha/tst-file-align.h | 20 ++++++++++++++++++++
sysdeps/generic/tst-file-align.h | 20 ++++++++++++++++++++
sysdeps/microblaze/tst-file-align.h | 20 ++++++++++++++++++++
sysdeps/nios2/tst-file-align.h | 20 ++++++++++++++++++++
6 files changed, 82 insertions(+), 6 deletions(-)
create mode 100644 sysdeps/alpha/tst-file-align.h
create mode 100644 sysdeps/generic/tst-file-align.h
create mode 100644 sysdeps/microblaze/tst-file-align.h
create mode 100644 sysdeps/nios2/tst-file-align.h
diff --git a/elf/tst-align3.c b/elf/tst-align3.c
index ac86d623a6..87a8ff81a0 100644
--- a/elf/tst-align3.c
+++ b/elf/tst-align3.c
@@ -17,11 +17,9 @@
<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);
diff --git a/elf/tst-alignmod3.c b/elf/tst-alignmod3.c
index 0d33f2379d..9520c35220 100644
--- a/elf/tst-alignmod3.c
+++ b/elf/tst-alignmod3.c
@@ -17,11 +17,9 @@
<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
index 0000000000..8fc3c9405d
--- /dev/null
+++ b/sysdeps/alpha/tst-file-align.h
@@ -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
index 0000000000..6ee6783a2a
--- /dev/null
+++ b/sysdeps/generic/tst-file-align.h
@@ -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
index 0000000000..43c58b29d7
--- /dev/null
+++ b/sysdeps/microblaze/tst-file-align.h
@@ -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
index 0000000000..589a2d5ad8
--- /dev/null
+++ b/sysdeps/nios2/tst-file-align.h
@@ -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
--
2.33.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] Support target specific ALIGN for variable alignment test [BZ #28676]
2021-12-10 23:53 [PATCH v3] Support target specific ALIGN for variable alignment test [BZ #28676] H.J. Lu
@ 2021-12-14 22:15 ` Adhemerval Zanella
0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2021-12-14 22:15 UTC (permalink / raw)
To: H.J. Lu, libc-alpha
On 10/12/2021 20:53, H.J. Lu wrote:
> 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.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> elf/tst-align3.c | 4 +---
> elf/tst-alignmod3.c | 4 +---
> sysdeps/alpha/tst-file-align.h | 20 ++++++++++++++++++++
> sysdeps/generic/tst-file-align.h | 20 ++++++++++++++++++++
> sysdeps/microblaze/tst-file-align.h | 20 ++++++++++++++++++++
> sysdeps/nios2/tst-file-align.h | 20 ++++++++++++++++++++
> 6 files changed, 82 insertions(+), 6 deletions(-)
> create mode 100644 sysdeps/alpha/tst-file-align.h
> create mode 100644 sysdeps/generic/tst-file-align.h
> create mode 100644 sysdeps/microblaze/tst-file-align.h
> create mode 100644 sysdeps/nios2/tst-file-align.h
>
> diff --git a/elf/tst-align3.c b/elf/tst-align3.c
> index ac86d623a6..87a8ff81a0 100644
> --- a/elf/tst-align3.c
> +++ b/elf/tst-align3.c
> @@ -17,11 +17,9 @@
> <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);
> diff --git a/elf/tst-alignmod3.c b/elf/tst-alignmod3.c
> index 0d33f2379d..9520c35220 100644
> --- a/elf/tst-alignmod3.c
> +++ b/elf/tst-alignmod3.c
> @@ -17,11 +17,9 @@
> <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
> index 0000000000..8fc3c9405d
> --- /dev/null
> +++ b/sysdeps/alpha/tst-file-align.h
> @@ -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
> index 0000000000..6ee6783a2a
> --- /dev/null
> +++ b/sysdeps/generic/tst-file-align.h
> @@ -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
> index 0000000000..43c58b29d7
> --- /dev/null
> +++ b/sysdeps/microblaze/tst-file-align.h
> @@ -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
> index 0000000000..589a2d5ad8
> --- /dev/null
> +++ b/sysdeps/nios2/tst-file-align.h
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-14 22:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 23:53 [PATCH v3] Support target specific ALIGN for variable alignment test [BZ #28676] H.J. Lu
2021-12-14 22:15 ` Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).