From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id E2B3E3858426; Fri, 12 May 2023 15:13:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2B3E3858426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=56823 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1pxUSE-001oPF-St; Fri, 12 May 2023 15:13:10 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.96) (envelope-from ) id 1pxUSE-000Bze-2N; Fri, 12 May 2023 17:13:10 +0200 From: Florian Weimer To: Lukasz Stelmach via Libc-alpha Cc: Lukasz Stelmach , schwab@suse.de, maskray@google.com, fweimer@redhat.com, palmer@dabbelt.com, adhemerval.zanella@linaro.org, joseph@codesourcery.com, binutils@sourceware.org, Marek Pikula , Marek Szyprowski , Karol Lewandowski Subject: Re: global pointer gets overwritten with dlopen(3) on RISC-V References: Date: Fri, 12 May 2023 17:13:10 +0200 In-Reply-To: (Lukasz Stelmach via Libc-alpha's message of "Fri, 12 May 2023 16:21:09 +0200") Message-ID: <87wn1dfurd.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: * Lukasz Stelmach via Libc-alpha: > We've got a program (the testee) written in C that we test with another > one (a testing harness, the tester) written in C++ with gtest. So far, > so good. To make the testing and inspection of the internal state of the > testee easier the tester does not start the testee as a separate process > but loads it with dlopen(3) and calls the testee's main() function. We specifically disallow this in current glibc because it does not work in general=E2=80=94unless the application is really loadable as a shar= ed object (compiled as PIC and linked with -shared).