From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id DB4973858430 for ; Mon, 10 Oct 2022 18:45:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB4973858430 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4MmSX14QSMz3jDD; Mon, 10 Oct 2022 18:45:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MmSX13dd8z3G82; Mon, 10 Oct 2022 18:45:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665427505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WSRR0IfKAaPotos+DPfBuG36UhoBSF4flxxAWk3OrSw=; b=yMS0ViZBLEwtiO9+JNKXKf5cxxeKwqRqRgTbYxGwfgm4qWFtRlbGhF6hugydPyEv3vkh5M IgO85HT4HsBtwlqkqdWf3j4Zj1A/6aEVc04WJSizLgHTR0qYcOE28aQmnM2Ohk9ZYOEU0g NLZIfLt1ZpDKyWSAyy+9pT234IZ9CqLIF2PfHPBhWld0qHRIU6fq0Gv6pacwiV+Ta+qjp7 6lSUxuCvIb73AlaI0IfkzgCwyvYDyTctI7Mkp9Zy/7N2y+aai0XnqHpwu4aLEwrE4p+e5J 7Oz/3GYR0Xcyv9qkwsgHnyWvPw8Q4m/kJNR5nkaQmAUcQnxlntGmxwZVlknrKA== Received: from [IPV6:2601:648:8684:ad0:94d8:ad3b:a95b:e90a] (unknown [IPv6:2601:648:8684:ad0:94d8:ad3b:a95b:e90a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4MmSX10cQNzv4d; Mon, 10 Oct 2022 18:45:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 10 Oct 2022 11:45:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Content-Language: en-US To: Kevin Buettner , gdb-patches@sourceware.org References: <20221008035716.46147-1-kevinb@redhat.com> <20221008035716.46147-3-kevinb@redhat.com> From: John Baldwin Subject: Re: [PATCH 2/2] Test stepping within a runtime loader / dynamic linker In-Reply-To: <20221008035716.46147-3-kevinb@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665427505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WSRR0IfKAaPotos+DPfBuG36UhoBSF4flxxAWk3OrSw=; b=HVT5kBnzm/RYbRvY5fGISCFB/ehIUVLh75OGeGLYpf4YhnGFyFTvX+b5JpZX5cNRLK1fN7 Q6wD2csjV2JoD9bDnkiXRoEwNmvnQ/5qmntcKLD2u9s8CWUfiYGh02vBD3WLj04GxgVcix QP7aIhiwNWTTfrDXg7XnyzVzUPhqqW3I031Ayia+5cqz74Zlrbd0PMuaytvjkinOIfiFZc ig2m/SdBYB50iP1ZAhfk1YTKJFCO8RJkLq3d+mcj0UT7LtZ8bkt4cpZBWVWnZDGtqxnK34 G0700P8qheUR8iCvYVSCMeL7Tm6kcg8YiNrW+TvEN8iXmN4yGPQZfdho8Rfbjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665427505; a=rsa-sha256; cv=none; b=fIO+uR+trfmb35NEEndwOIdEElkYDXsTDNj77x7g1nXcAG1c0beEwK0T1Cdk4YlkQdsxsZ TnRItc0wM6zxVQg9c+cow0PkodBJZbDDaFpCbmYk/tefmM5KFS3wB1RJ+ELmq8jGGtKcVA mCicyxmC8T8Sca2DvmTD4ClL8eq0a5DmfkgR2bVCMb4uAXkZtb4+1OvtjxwPb9kQEuUgot /Wh8+nzLx9ULt4ayUuJoUlAu82NhJPqqhdGiPA3DnFC32lqyGKYuAtGaklvwnoN/5BWz88 rmATrtoLBiqFDOZCrTkiNCIscs3A374F4pAs5WZvqf6//IWQNWN89WWqPvvh0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2022 18:45:07 -0000 On 10/7/22 8:57 PM, Kevin Buettner via Gdb-patches wrote: > See the remarks in rtld-step.exp for a description of what this > test is about. > > This test case has been tested using gcc on the following x86-64 Linux > distributions/releases: > > Fedora 28 > Fedora 32 > Fedora 33 > Fedora 34 > Fedora 35 > Fedora 36 > Fedora 37 > rawhide (f38) > RHEL 9.1 > Ubuntu 22.04.1 LTS > > It's also been tested (and found to be working) with > RUNTESTFLAGS="CC_FOR_TARGET=clang" on all of the above expect for > Fedora 28. The (old) version of clang available on F28 did not > accept the -static-pie option. > > I also tried to make this test work on FreeBSD 13.1. While I think I > made significant progress, I was ultimately stymied by this message > which occurs when attempting to run the main program which has been > set to use the fake/pretend RTLD as the ELF interpreter: > > ELF interpreter /path/to/rtld-step-rtld not found, error 22 > > I have left one of the flags (-static) in place which I believe > to be needed for FreeBSD (though since I never got it to work, I > don't know for sure.) I've also left some declarations needed > for FreeBSD in rtld-step-rtld.c. They're currently disabled via > a #if 0; you'll need to enable them if you want to try to make > it work on FreeBSD. Hmm, thanks for testing on FreeBSD. FreeBSD currently doesn't support static PIE binaries, so I think the failure you ran into is not unexpected. In terms of the feature, this is indeed useful (I sometimes need to step inside rtld myself). I think your implementation in patch 1 makes sense. -- John Baldwin