From patchwork Fri Oct 1 17:22:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Kosnik X-Patchwork-Id: 66468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3694DB70E1 for ; Sat, 2 Oct 2010 03:22:35 +1000 (EST) Received: (qmail 552 invoked by alias); 1 Oct 2010 17:22:31 -0000 Received: (qmail 521 invoked by uid 22791); 1 Oct 2010 17:22:29 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Oct 2010 17:22:15 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o91HMDSD008037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Oct 2010 13:22:13 -0400 Received: from shotwell (ovpn-113-21.phx2.redhat.com [10.3.113.21]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o91HMD8T019417; Fri, 1 Oct 2010 13:22:13 -0400 Date: Fri, 1 Oct 2010 12:22:12 -0500 From: Benjamin Kosnik To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [v3] add tls symbols to abi checking Message-ID: <20101001122212.1165f1a4@shotwell> Mime-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org As pointed out by Rainer, the current symbol-list checking for libstdc++.so does not track exported TLS symbols. This is an oversight that is corrected in the following patch. There should not be a difference in test results for this, as the symbols were properly versioned from the beginning, yet ignored. This just starts to pay attention to them. tested x86_64/linux, make check-abi, verified that the two new symbols show up as expected. -benjamin 2010-10-01 Benjamin Kosnik * scripts/extract_symvers: Add support for tracking TLS symbols. * testsuite/util/testsuite_abi.h (symbol::category): Add tls type. * testsuite/util/testsuite_abi.cc: Set symbol type to tls when appropriate, collect size info. Index: scripts/extract_symvers =================================================================== --- scripts/extract_symvers (revision 164890) +++ scripts/extract_symvers (working copy) @@ -92,7 +92,7 @@ egrep -v ' (LOCAL|UND) ' |\ awk '{ if ($4 == "FUNC" || $4 == "NOTYPE") printf "%s:%s\n", $4, $8; - else if ($4 == "OBJECT") + else if ($4 == "OBJECT" || $4 == "TLS") printf "%s:%s:%s\n", $4, $3, $8; }' | sort | uniq > $tmp 2>&1 # else printf "Huh? What is %s?\n", $8; Index: testsuite/util/testsuite_abi.cc =================================================================== --- testsuite/util/testsuite_abi.cc (revision 164890) +++ testsuite/util/testsuite_abi.cc (working copy) @@ -43,13 +43,15 @@ type = symbol::function; else if (data.find("OBJECT") == 0) type = symbol::object; + else if (data.find("TLS") == 0) + type = symbol::tls; n = data.find_first_of(delim); if (n != npos) data.erase(data.begin(), data.begin() + n + 1); - // Iff object, get size info. - if (type == symbol::object) + // Iff object or TLS, get size info. + if (type == symbol::object || type == symbol::tls) { n = data.find_first_of(delim); if (n != npos) @@ -130,6 +132,9 @@ case object: type_string = "object"; break; + case tls: + type_string = "tls"; + break; case uncategorized: type_string = "uncategorized"; break; @@ -138,7 +143,7 @@ } cout << "type: " << type_string << endl; - if (type == object) + if (type == object || type == tls) cout << "type size: " << size << endl; string status_string; Index: testsuite/util/testsuite_abi.h =================================================================== --- testsuite/util/testsuite_abi.h (revision 164890) +++ testsuite/util/testsuite_abi.h (working copy) @@ -29,7 +29,7 @@ // Encapsulates symbol characteristics. struct symbol { - enum category { function, object, uncategorized }; + enum category { function, object, tls, uncategorized }; enum designation { existing, added, subtracted, undesignated }; enum version { none, compatible, incompatible, unversioned }; enum compatibility