From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by inbox.vuxu.org (OpenSMTPD) with SMTP id 16c0cebf for ; Wed, 29 Jan 2020 23:20:42 +0000 (UTC) Received: (qmail 32347 invoked by uid 550); 29 Jan 2020 23:20:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32329 invoked from network); 29 Jan 2020 23:20:40 -0000 Date: Thu, 30 Jan 2020 00:20:28 +0100 From: Szabolcs Nagy To: musl@lists.openwall.com Message-ID: <20200129232028.GZ23985@port70.net> Mail-Followup-To: musl@lists.openwall.com References: <20200129205330.GK30412@brightrain.aerifal.cx> <20200129211024.GY23985@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [musl] Static linking is broken after creation of DT_TEXTREL segment * =D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9 =D0=90=D0=BB=D0=B0=D0=B4=D1=8C=D0=B5= =D0=B2 [2020-01-30 00:35:52 +0300]: > "readelf -d main | grep TEXTREL" returns the same text on both musl and > glibc containers: >=20 > 0x0000000000000016 (TEXTREL) 0x0 > 0x000000000000001e (FLAGS) TEXTREL ok so the glibc executable is broken too, you just didn't notice because it's silently wasting resources and will only fail with pax or selinux hardened setups. > > i'm also surprised that it was only a warning, i think gcc default pie > toolchain passes -z text nowadays exactly to make this a link time failur= e. > this is probably a gentoo toolchain bug. >=20 > What do you mean "-z text"? We can report improvement for gentoo. it's an ld flag that makes textrels an error, a toolchain that defaults to pie should pass it to the linker because otherwise it's easy to get textrels unintentionally.