From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 678211F4B4 for ; Thu, 24 Sep 2020 09:53:36 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB356384A022; Thu, 24 Sep 2020 09:53:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB356384A022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1600941214; bh=ai3CHfBTawtpG59HOcHx/mUSoda0ssTOO9VU5+hsh8c=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=gDOIQ024FAlOju5+92LP7Hiup/bOxP0fv9yTESfL9B3nXvJ0u4A3uD9trIwByt095 uNaHeRGgLXkMTNAx6c4PpvsYajAn0mEOx9pZHZBNjMzIxnVpPMGJzsffZ9jayD1hf2 ncxqvnJYRJj2P4Z7R1gQDgI3CpdrqGKfpb7EGQwI= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 00DC5384B13C for ; Thu, 24 Sep 2020 09:53:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 00DC5384B13C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-5iwuxqW1OM6j6t95-Nd4Lw-1; Thu, 24 Sep 2020 05:53:16 -0400 X-MC-Unique: 5iwuxqW1OM6j6t95-Nd4Lw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9335056B59 for ; Thu, 24 Sep 2020 09:53:15 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-114-84.ams2.redhat.com [10.36.114.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA38A73693; Thu, 24 Sep 2020 09:53:14 +0000 (UTC) To: vincent via Libc-alpha Subject: Re: [PATCH v5] ld.so: add an --argv0 option References: <20200914213206.118361-1-vmihalko@redhat.com> <20200923060646.172273-1-vmihalko@redhat.com> Date: Thu, 24 Sep 2020 11:53:13 +0200 In-Reply-To: <20200923060646.172273-1-vmihalko@redhat.com> (vincent via Libc-alpha's message of "Wed, 23 Sep 2020 08:06:46 +0200") Message-ID: <87ft77mrg6.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: vmihalko@redhat.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * vincent via Libc-alpha: > is there any problem with this patch? I think adding a NEWS entry would make sense. > +ARGV0 = test-argv0 > +$(objpfx)argv0test.out: tst-rtld-argv0.sh $(objpfx)ld.so \ > + $(objpfx)argv0test > + $(SHELL) $< $(objpfx)ld.so $(objpfx)argv0test \ > + '$(test-wrapper-env)' '$(run_program_env)' \ > + '$(rpath-link)' '$(ARGV0)' > $@; \ > + $(evaluate-test) Here I do not think the ARGV0 variable adds much clarity. > +#include > +#include > + > +static int > +do_test (int argc, char **argv) > +{ > + TEST_COMPARE_BLOB (argv[0], strlen (argv[0]), > + "test-argv0", strlen ("test-argv0")); > + return 0; > +} You can use TEST_COMPARE_STRING, which will do the strlen for you. The patch itself looks okay to me. Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill