From patchwork Fri May 20 15:05:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Baldwin X-Patchwork-Id: 96618 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 52C38B71A2 for ; Sat, 21 May 2011 01:05:59 +1000 (EST) Received: (qmail 2679 invoked by alias); 20 May 2011 15:05:57 -0000 Received: (qmail 2664 invoked by uid 22791); 20 May 2011 15:05:57 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 May 2011 15:05:42 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id p4KF5gSx009820; Fri, 20 May 2011 08:05:42 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by wpaz29.hot.corp.google.com with ESMTP id p4KF5YHR027827; Fri, 20 May 2011 08:05:34 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 9603) id 1A9281DA1DE; Fri, 20 May 2011 11:05:29 -0400 (EDT) To: gcc-patches@gcc.gnu.org, ppluzhnikov@google.com, libstdc++@gcc.gnu.org Subject: [Patch] Make libstdc++'s abi_check more robust against readelf output format Cc: c@google.com Message-Id: <20110520150530.1A9281DA1DE@topo.tor.corp.google.com> Date: Fri, 20 May 2011 11:05:29 -0400 (EDT) From: simonb@google.com (Simon Baldwin) X-System-Of-Record: true X-IsSubscribed: yes 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 Make libstdc++'s abi_check more robust against readelf output format. libstdc++-abi/abi_check in the libstdc++-v3 testsuite relies on a fixed number of space separated fields in readelf output. However, the field count for readelf output can vary where the library contains OS or processor specific bindings, or other unknown bindings. This patch replaces the strings that readelf outputs for such bindings with alternative strings that use underscores in place of space. It preserves the count of fields for such cases, and allows the awk statement that follows to find the desired field correctly with $n. OK for trunk? libstdc++-v3/ChangeLog: 2011-05-20 Simon Baldwin * scripts/extract_symvers.in: Handle processor/OS specific or unknown symbol binding strings from readelf. Index: libstdc++-v3/scripts/extract_symvers.in =================================================================== --- libstdc++-v3/scripts/extract_symvers.in (revision 173951) +++ libstdc++-v3/scripts/extract_symvers.in (working copy) @@ -52,6 +52,9 @@ SunOS) ${readelf} ${lib} |\ sed -e 's/ \[: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\ egrep -v ' (LOCAL|UND) ' |\ + sed -e 's/ : / :_/g' |\ + sed -e 's/ : / :_/g' |\ + sed -e 's/ : / :_/g' |\ awk '{ if ($4 == "FUNC" || $4 == "NOTYPE") printf "%s:%s\n", $4, $8; else if ($4 == "OBJECT" || $4 == "TLS")