From patchwork Sun Oct 15 15:12:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 23579 Received: (qmail 83059 invoked by alias); 15 Oct 2017 15:12:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 83050 invoked by uid 89); 15 Oct 2017 15:12:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pg0-f47.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=Iuo/QauAy0sceZSc6PRfqP9XaTIk5Na87Bhau5B/DG8=; b=oZ0VSt9ZnyFXAaUmUmpFmGO6QElzJFywu/wZPOYKdbkGMoE1jXISDKN1nYoFXdVwQL UQ8VxFlzx11r4cDT90ujNVep92qLX2DIDdJLCzhu45BxubmAKdNrDI716jM9hkMrZ4+9 wKQyzrpW1qDVy1Lq0YEMVMNpCn1QMjMNfeAKebLPG/xNhG+1O+Zou3xb1J8ZjFh+EM5t BKIMqr4EB2T4TezQzQ/tzOEYQGLiypWAWAKIlQ0137ypNYyjMNO4h/zqeWnnItuygL8c 1FG849LEneyh4vHYkYyrVai+HklEkFuRe7rkMUY7JTym8deqyeiKR+b4smsLK3mvnFP4 fJ9w== X-Gm-Message-State: AMCzsaVEUIYzhCKV+p4YA0PqGern8SR71G47QQ7ANAsj+uUiYK1iFe93 O2ArLdxcN25E/sB+mM9ENu93hQ== X-Google-Smtp-Source: AOwi7QDodOI8ceuwUXuskM5/HGBsSb4MSmqcOxjCttsF1jPGlIGjBo9ebnESKk5G3OusvW0MMW1ADw== X-Received: by 10.98.32.12 with SMTP id g12mr6391660pfg.196.1508080347194; Sun, 15 Oct 2017 08:12:27 -0700 (PDT) Date: Sun, 15 Oct 2017 08:12:26 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] x32: Verify that NPTL structures are correct [BZ #22298] Message-ID: <20171015151226.GA25459@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) Add a build-time check to verify that NPTL structures are correct. OK for master and 2.25/2.26 branches after fix for [BZ #22298] is applied? H.J. [BZ #22298] * sysdeps/x86_64/x32/nptl/Makefile: New file. * sysdeps/x86_64/x32/nptl/nptl-check.sym: Likewise. --- sysdeps/x86_64/x32/nptl/Makefile | 4 ++++ sysdeps/x86_64/x32/nptl/nptl-check.sym | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 sysdeps/x86_64/x32/nptl/Makefile create mode 100644 sysdeps/x86_64/x32/nptl/nptl-check.sym diff --git a/sysdeps/x86_64/x32/nptl/Makefile b/sysdeps/x86_64/x32/nptl/Makefile new file mode 100644 index 0000000000..e780beaf11 --- /dev/null +++ b/sysdeps/x86_64/x32/nptl/Makefile @@ -0,0 +1,4 @@ +ifeq ($(subdir),csu) +# Verify that NPTL structures are correct. +gen-as-const-headers += nptl-check.sym +endif diff --git a/sysdeps/x86_64/x32/nptl/nptl-check.sym b/sysdeps/x86_64/x32/nptl/nptl-check.sym new file mode 100644 index 0000000000..c4b07b83bf --- /dev/null +++ b/sysdeps/x86_64/x32/nptl/nptl-check.sym @@ -0,0 +1,9 @@ +#include +#include + +PREV offsetof (struct __pthread_internal_list, __prev) +NEXT offsetof (struct __pthread_internal_list, __next) + +#if __PTHREAD_MUTEX_HAVE_PREV != 1 +# error __PTHREAD_MUTEX_HAVE_PREV must be 1 +#endif