From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 7725738540AD for ; Wed, 14 Dec 2022 22:22:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7725738540AD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x229.google.com with SMTP id v82so3844197oib.4 for ; Wed, 14 Dec 2022 14:22:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=c121H/7IVjjzAj7HyxeUJKr1iCFmK698GthIIUdOE0o=; b=iDXmLmfT3nelTZkkbJiTyBCPG9/4KrOtOlr9oNkAzWLSLP+epoMy0JxMk52YXlMIOH 1WfV1PoHpkC2a5oDqd0S9e1me6VwKZfmcR+8B2FzeYpDGvYEsbHWfTxSoq4NtIIqNyJd bgg+FJbSwKNmLpMAmoRGfyi7vDDr5oPKZke87lCfdMpHcKepWfXIV+hA/YX4JSdXnCTt m8sB/x1+Zq5uxDCocwLo6Sk8s/Lba2B/SoH7/HaFnlJ/RBma9H5GBuuncmjZIfVXDHl+ nNCgrDxAIw+rkWGnaujqNnnCIM45zPiC7vLqGO/AJva7FaVliZuW9l4X6Vc+tfe5luty v92w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c121H/7IVjjzAj7HyxeUJKr1iCFmK698GthIIUdOE0o=; b=sgKCdQ2FgwCXhX/Te1RIWlsuTVtjqL5wJ/8C7XG7mS14a13PRVCgDRXk8ceWxnQ4Jg ckx7W5uuxUEpl71+OiwVYtcGsXailvHMgpmPttFaZjDLRPBslRSdNzbR+J9lkIVYmlKQ Y/p39948FQTvjuqOMkAjDUGWMQmSIiEps2fYn4K5PhyYbycD7tIS3Nzg9o2afp1L99lN Gj1zDokXbW8YdXjcqFT212H58HFKutme45/cZeCxuh8PNOlVCPAgBn33pFEwbSD2oLdj Vl/kOqcbp1DeRVvc6Cj2MF7iNKZaoFJpCI4G44cORyC5N3ctmWVLq6NCLUThmhhYAN4z 8foQ== X-Gm-Message-State: ANoB5plE2yCwDG4QAR+CVIlf+xyW1LmtDuisZ2QKAfF7zHv7uI99/5RQ Itx+onaq8bCSvJZ+u92tnssMRQ== X-Google-Smtp-Source: AA0mqf5sx+HnElcE7NzEMJxtCDOW6RGLOSIXkmx33inKx2Hcsr7AuZbbW70QG+xNNe6RmHhbnxN5UA== X-Received: by 2002:a54:4892:0:b0:35e:4002:d914 with SMTP id r18-20020a544892000000b0035e4002d914mr11615438oic.2.1671056576587; Wed, 14 Dec 2022 14:22:56 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c2:f05e:98ce:57c2:5097:ae83? ([2804:1b3:a7c2:f05e:98ce:57c2:5097:ae83]) by smtp.gmail.com with ESMTPSA id f6-20020a05680814c600b0035bd65b776bsm419835oiw.2.2022.12.14.14.22.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Dec 2022 14:22:55 -0800 (PST) Message-ID: <866d46dc-87d4-c18d-309f-20479caf5262@linaro.org> Date: Wed, 14 Dec 2022 19:22:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] elf: Fix tst-relro-symbols.py argument passing Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org References: <20221214212036.1038959-1-adhemerval.zanella@linaro.org> <87bko5lkwb.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87bko5lkwb.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On 14/12/22 18:45, Florian Weimer wrote: > * 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 = argparse.ArgumentParser(description=__doc__) >> parser.add_argument('object', help='path to object file to check') >> - parser.add_argument('--required', metavar='NAME', default=(), >> - help='required symbol names', nargs='*') >> - parser.add_argument('--optional', metavar='NAME', default=(), >> - help='required symbol names', nargs='*') >> + parser.add_argument('--required', metavar='NAME', action='append', >> + help='required symbol names') >> + parser.add_argument('--optional', metavar='NAME', action='append', >> + help='required symbol names') >> return parser >> >> 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=undefined --required=_rtld_global_ro /lib64/ld-linux-x86-64.so.2 > Traceback (most recent call last): > File "…/src/gnu/glibc/git/elf/tst-relro-symbols.py", line 137, in > main(sys.argv[1:]) > File "…/src/gnu/glibc/git/elf/tst-relro-symbols.py", line 73, in main > optional_symbols = frozenset([sym.encode('UTF-8') > ^^^^^^^^^^^^^^^^^^^^ > TypeError: 'NoneType' object is not iterable > It does work for tst-relro-libc.out, although it would be good to allow either empty --required or --optional.