From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A653838518A7 for ; Wed, 14 Dec 2022 21:45:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A653838518A7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671054328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zd0ctcTnkjdwZLF3XcfJxJ1VkgElt4HpnQX01pk8UqI=; b=eZQKjj78y3cQlCJAz2ROI8Xl8i+oWxDXorfy2nx/hg2eVCvmGS86HPceHCY8Uvdpnr7hsk KJyBzxg9BOUesAF2I7id/DElK9fI3phawk9/Iw9VheIe8Fi1WZJ8XWPKKbynb738YJpje/ +Wd7CwhsgrRgOBH0bNnmQhqjjqhGEXs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-499-WHc9-QonNE6tq_qVMQ5elA-1; Wed, 14 Dec 2022 16:45:27 -0500 X-MC-Unique: WHc9-QonNE6tq_qVMQ5elA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6F74857A81; Wed, 14 Dec 2022 21:45:26 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B46940C2064; Wed, 14 Dec 2022 21:45:26 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] elf: Fix tst-relro-symbols.py argument passing References: <20221214212036.1038959-1-adhemerval.zanella@linaro.org> Date: Wed, 14 Dec 2022 22:45:24 +0100 In-Reply-To: <20221214212036.1038959-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Wed, 14 Dec 2022 18:20:36 -0300") Message-ID: <87bko5lkwb.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Adhemerval Zanella: > Current scheme only consideres the first argument for both --required > and --optional, where the idea is to append a new item. > > Checked on x86_64-linux-gnu. > --- > elf/tst-relro-symbols.py | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/elf/tst-relro-symbols.py b/elf/tst-relro-symbols.py > index 368ea3349f..41e87b37ea 100644 > --- a/elf/tst-relro-symbols.py > +++ b/elf/tst-relro-symbols.py > @@ -56,10 +56,10 @@ def get_parser(): > """Return an argument parser for this script.""" > parser =3D argparse.ArgumentParser(description=3D__doc__) > parser.add_argument('object', help=3D'path to object file to check') > - parser.add_argument('--required', metavar=3D'NAME', default=3D(), > - help=3D'required symbol names', nargs=3D'*') > - parser.add_argument('--optional', metavar=3D'NAME', default=3D(), > - help=3D'required symbol names', nargs=3D'*') > + parser.add_argument('--required', metavar=3D'NAME', action=3D'append= ', > + help=3D'required symbol names') > + parser.add_argument('--optional', metavar=3D'NAME', action=3D'append= ', > + help=3D'required symbol names') > return parser > =20 > def main(argv): Ugh, right, that's a bug. But your fix does not seem to work, either: $ python3 elf/tst-relro-symbols.py --required=3Dundefined --required=3D_rtl= d_global_ro /lib64/ld-linux-x86-64.so.2=20 Traceback (most recent call last): File "=E2=80=A6/src/gnu/glibc/git/elf/tst-relro-symbols.py", line 137, in= main(sys.argv[1:]) File "=E2=80=A6/src/gnu/glibc/git/elf/tst-relro-symbols.py", line 73, in = main optional_symbols =3D frozenset([sym.encode('UTF-8') ^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable Thanks, Florian