From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Rg4NI-00074J-JV for garchives@archives.gentoo.org; Thu, 29 Dec 2011 01:01:41 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A644121C169; Thu, 29 Dec 2011 01:00:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 615FF21C169 for ; Thu, 29 Dec 2011 01:00:48 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C63F11B404D for ; Thu, 29 Dec 2011 01:00:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id DB1DA80056 for ; Thu, 29 Dec 2011 01:00:46 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <5d63784b7d6348ccf041ef18b2340936a7924d18.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:elfix-0.4.x commit in: scripts/ X-VCS-Repository: proj/elfix X-VCS-Files: scripts/revdep-pax X-VCS-Directories: scripts/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 5d63784b7d6348ccf041ef18b2340936a7924d18 Date: Thu, 29 Dec 2011 01:00:46 +0000 (UTC) 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: 9416e9fc-5d40-466c-973b-e6bee938e32f X-Archives-Hash: 30d149539a15e303b61a6168f70eda1f commit: 5d63784b7d6348ccf041ef18b2340936a7924d18 Author: Anthony G. Basile gentoo org> AuthorDate: Wed Dec 28 16:37:17 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Thu Dec 29 00:58:33 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D5d63784b scripts/revdep-pax: warn only for complex markings --- scripts/revdep-pax | 57 +++++++++++++++++++++++++++++++++++++---------= ----- 1 files changed, 41 insertions(+), 16 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index e2073da..be6a387 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -187,20 +187,45 @@ def run_reverse(verbose, executable_only): print_reverse_linkings( reverse_linkings, so2library_mappings, verbose,= executable_only) =20 =20 -def migrate_flags(elf, pax_flags): - """ - Importer Exporter Result - Force On Force On Force On - Force On Force Off Warn Only - Force On Nothing Force On - Force Off Force On Warn Only - Force Off Force Off Force Off - Force Off Nothing Force Off - Nothing Force On Force On - Nothing Force Off Force Off - Nothing Nothing Nothing - """ - pax.setflags(elf, pax_flags) +def migrate_flags(importer, exporter_str_flags, exporter_bin_flags): + # We implement the following logic for setting the pax flags + # on the target elf object, the 'importer', given that the + # flags from the elf object we want it to match to, the exporter. + # + # Importer Exporter Result + # Force On Force On Force On + # Force On Force Off Force On + Warn + # Force On Nothing Force On + # Force Off Force On Force Off + Warn + # Force Off Force Off Force Off + # Force Off Nothing Force Off + # Nothing Force On Force On + # Nothing Force Off Force Off + # Nothing Nothing Nothing + # + # The algorithm proceeds by assuming the resulting flags =3D the export= er + # flags and then changes them in cases where that's not what we want, i= e + # + # Force On Force Off Force On + Warn + # Force On Nothing Force On + # Force Off Force On Force Off + Warn + # Force Off Nothing Force Off + + ( importer_str_flags, importer_bin_flags ) =3D pax.getflags(importer) + + result_bin_flags =3D exporter_bin_flags + + for i in range(len(importer_str_flags)): + if importer_str_flags[i].isupper() and exporter_str_flags[i].islower()= : + print 'Warning: importer =3D %s exporter =3D %s' % ( importer_str_fl= ags[i], exporter_str_flags[i] ) + if importer_str_flags[i].isupper() and exporter_str_flags[i] =3D=3D '-= ': + print 'Warning: importer =3D %s exporter =3D %s' % ( importer_str_fl= ags[i], exporter_str_flags[i] ) + if importer_str_flags[i].islower() and exporter_str_flags[i].isupper()= : + print 'Warning: importer =3D %s exporter =3D %s' % ( importer_str_fl= ags[i], exporter_str_flags[i] ) + if importer_str_flags[i].islower() and exporter_str_flags[i] =3D=3D '-= ': + print 'Warning: importer =3D %s exporter =3D %s' % ( importer_str_fl= ags[i], exporter_str_flags[i] ) + + pax.setflags(importer, result_bin_flags) =20 =20 def run_binary(binary, verbose, mark): @@ -246,7 +271,7 @@ def run_binary(binary, verbose, mark): =20 if do_marking: try: - migrate_flags(library, binary_bin_flags) + migrate_flags(library, binary_str_flags, binary_bin_flags) except: print "\n\tCould not set pax flags on %s, file is probably busy" %= library print "\tShut down all processes that use it and try again" @@ -326,7 +351,7 @@ def run_soname(name, verbose, use_soname, mark, execu= table_only): print '\t\tPlease enter y or n' if do_marking: try: - migrate_flags(binary, library_bin_flags) + migrate_flags(binary, library_str_flags, library_bin_flags) except: print "\n\tCould not set pax flags on %s, file is probably busy" %= binary print "\tShut down all processes that use it and try again"