From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1L28Xz-0000TU-3f for garchives@archives.gentoo.org; Mon, 17 Nov 2008 18:10:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0C04BE040D; Mon, 17 Nov 2008 18:10:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B162AE040D for ; Mon, 17 Nov 2008 18:10:02 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id A678A64C52 for ; Mon, 17 Nov 2008 18:10:00 +0000 (UTC) Received: from flameeyes by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1L28Xr-00032e-Dl for gentoo-commits@lists.gentoo.org; Mon, 17 Nov 2008 18:10:00 +0000 From: "Diego Petteno (flameeyes)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, flameeyes@gentoo.org Subject: [gentoo-commits] gentoo-projects commit in pax-utils: scanelf.c X-VCS-Repository: gentoo-projects X-VCS-Files: scanelf.c X-VCS-Directories: pax-utils X-VCS-Committer: flameeyes X-VCS-Committer-Name: Diego Petteno Content-Type: text/plain; charset=utf8 Message-Id: Sender: Diego Petteno Date: Mon, 17 Nov 2008 18:09:55 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 3ea7d4cc-87c0-4fff-8aba-00c4ead28af5 X-Archives-Hash: 87bd4397f6f6b313a90feb85cb9217a2 flameeyes 08/11/17 18:09:55 Modified: scanelf.c Log: Remove the half-assed versioned_symname support. =20 Matching against versioned symbol is possible (when the file is not stripped, for now) by using the regular expression matching (-g). Revision Changes Path 1.198 pax-utils/scanelf.c file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/sca= nelf.c?rev=3D1.198&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/sca= nelf.c?rev=3D1.198&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/sca= nelf.c?r1=3D1.197&r2=3D1.198 Index: scanelf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v retrieving revision 1.197 retrieving revision 1.198 diff -u -r1.197 -r1.198 --- scanelf.c 17 Nov 2008 18:03:38 -0000 1.197 +++ scanelf.c 17 Nov 2008 18:09:55 -0000 1.198 @@ -1,13 +1,13 @@ /* * Copyright 2003-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.197 200= 8/11/17 18:03:38 flameeyes Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.198 200= 8/11/17 18:09:55 flameeyes Exp $ * * Copyright 2003-2007 Ned Ludd - * Copyright 2004-2007 Mike Frysinger - */ =20 -static const char *rcsid =3D "$Id: scanelf.c,v 1.197 2008/11/17 18:03:38= flameeyes Exp $"; +static const char *rcsid =3D "$Id: scanelf.c,v 1.198 2008/11/17 18:09:55= flameeyes Exp $"; const char * const argv0 =3D "scanelf"; =20 #include "paxinc.h" @@ -57,7 +57,7 @@ static char be_verbose =3D 0; static char be_wewy_wewy_quiet =3D 0; static char be_semi_verbose =3D 0; -static char *find_sym =3D NULL, *versioned_symname =3D NULL; +static char *find_sym =3D NULL; static char *find_lib =3D NULL; static char *find_section =3D NULL; static char *out_format =3D NULL; @@ -977,19 +977,15 @@ return NULL; } =20 -static int scanelf_match_symname(const char *compare, const char *symnam= e, const char *symname_ver) { +static int scanelf_match_symname(const char *symname, const char *tomatc= h) { /* We do things differently when checking with regexp */ if (g_match) { - return rematch(symname, compare, REG_EXTENDED) =3D=3D 0 || - rematch(symname_ver, compare, REG_EXTENDED) =3D=3D 0; + return rematch(symname, tomatch, REG_EXTENDED) =3D=3D 0; } else { const size_t symname_len =3D strlen(symname); - if (strncmp(symname, compare, symname_len) =3D=3D 0 && - /* Accept unversioned symbol names */ - (compare[symname_len] =3D=3D '\0' || compare[symname_len] =3D=3D = '@')) - return 1; - - return strcmp(symname_ver, symname) =3D=3D 0; + return (strncmp(symname, tomatch, symname_len) =3D=3D 0 && + /* Accept unversioned symbol names */ + (tomatch[symname_len] =3D=3D '\0' || tomatch[symname_len] =3D=3D '@')= ); } } =20 @@ -1038,9 +1034,8 @@ *found_sym =3D 1; \ } else { \ /* allow the user to specify a comma delimited list of symbols to s= earch for */ \ - char *this_sym, *this_sym_ver, *next_sym; \ + char *this_sym, *next_sym; \ next_sym =3D ret; \ - this_sym_ver =3D versioned_symname; \ while (next_sym) { \ this_sym =3D next_sym; \ if ((next_sym =3D strchr(this_sym, ','))) \ @@ -1050,18 +1045,16 @@ if (sym->st_shndx =3D=3D SHN_UNDEF) \ continue; \ ++this_sym; \ - ++this_sym_ver; \ /* do we want an undefined symbol ? */ \ } else if (*this_sym =3D=3D '-') { \ if (sym->st_shndx !=3D SHN_UNDEF) \ continue; \ ++this_sym; \ - ++this_sym_ver; \ } \ if (next_sym) /* Copy it so that we don't have to worry about the = final , */ \ this_sym =3D strndup(this_sym, next_sym-this_sym); \ /* ok, lets compare the name now */ \ - if (scanelf_match_symname(symname, this_sym, this_sym_ver)) { \ + if (scanelf_match_symname(this_sym, symname)) { \ if (be_semi_verbose) { \ char buf[126]; \ snprintf(buf, sizeof(buf), "%lX %s %s", \ @@ -1785,8 +1778,6 @@ case 's': { if (find_sym) warn("You prob don't want to specify -s twice"); find_sym =3D optarg; - versioned_symname =3D xmalloc(sizeof(char) * (strlen(find_sym)+1+1)); - sprintf(versioned_symname, "%s@", find_sym); break; } case 'N': { @@ -1969,7 +1960,6 @@ } =20 /* clean up */ - free(versioned_symname); for (i =3D 0; ldpaths[i]; ++i) free(ldpaths[i]); =20