From patchwork Fri Dec 10 23:53:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 48828 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E66923857C72 for ; Fri, 10 Dec 2021 23:53:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E66923857C72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639180425; bh=5nZ8W3NpExRPaN4CO9exVRkXuTl+M/FbIc+Z0t+Iw3M=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Cn9qQFB99jPKvX6DoxJUpeal+vTbXAdgF2SR8D67UVGkrZfTA7sR2AOcwP5HE5cv3 4UEmvzakCIRmdAp+3jAX7jB/xKytyo3Ev42v+A+PUil9QX6T3LX48CSgdHtUykPtrc +k54faIdX6nDYkrZYQYBJbOgtdnwq6xlMP2uTylw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id DEE793858405 for ; Fri, 10 Dec 2021 23:53:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DEE793858405 Received: by mail-pj1-x1036.google.com with SMTP id cq22-20020a17090af99600b001a9550a17a5so10565029pjb.2 for ; Fri, 10 Dec 2021 15:53:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5nZ8W3NpExRPaN4CO9exVRkXuTl+M/FbIc+Z0t+Iw3M=; b=1z+CZU/ARv0jFEvu1QWBX4i/GKksluGjDhMdxWv6puLzSt0uef100LgKmS4NrawTLZ fYwY7byhhQVXa53YaVUiRaJugurvV8d6jxDxJRE6QgYYysbm/8/pYvn2hb5j6+tn9ut1 6u/opVIeakEh28knT7Pxkeuxaakqz+biCwBl8JJ2AemRpFOrwI2ou0ZKM6cwOiIzLuxK H2vRCOYypmB3YLSbKb/lUw0/8UFq463y7RBeeZkXaBKgXSmzw2VGJZ8MN7ZiJZsOzJqJ w4xdaAjv7DLcWuoc2e+mEs71re5lxAMrCmcHgfXG+2XYogqIyDb9eJfL25pMtc71YwL4 eu8w== X-Gm-Message-State: AOAM532olXFcmSggY1OVCE9vqfxPTTqgsr6PuhKl5Fvf0HgYsHBtxXnG hyWXQss8uxFAhViWmgKhJngo6oYC96E= X-Google-Smtp-Source: ABdhPJw6dGALrVzjown/mi7XG67709iD0mKrd4RI0OqqESspY9GGvtJ6SkFHcOAg6xE1po2sgsFYqQ== X-Received: by 2002:a17:90a:2843:: with SMTP id p3mr28064280pjf.176.1639180402892; Fri, 10 Dec 2021 15:53:22 -0800 (PST) Received: from gnu-cfl-2.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id rm1sm118702pjb.3.2021.12.10.15.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 15:53:22 -0800 (PST) Received: from gnu-tgl-2.localdomain (gnu-tgl-2 [192.168.1.34]) by gnu-cfl-2.localdomain (Postfix) with ESMTPS id 6E83942145A; Fri, 10 Dec 2021 15:53:21 -0800 (PST) Received: from gnu-tgl-2.. (localhost [IPv6:::1]) by gnu-tgl-2.localdomain (Postfix) with ESMTP id 8FC62300350; Fri, 10 Dec 2021 15:53:17 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v3] Support target specific ALIGN for variable alignment test [BZ #28676] Date: Fri, 10 Dec 2021 15:53:17 -0800 Message-Id: <20211210235317.3465758-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3029.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Add 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 --- 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 @@ . */ #include +#include #include -/* 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 @@ . */ #include +#include #include -/* 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 + . */ + +/* 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 + . */ + +/* 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 + . */ + +/* 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 + . */ + +/* This should cover all possible alignments we currently support. */ +#define ALIGN 0x8000