From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9031 invoked by alias); 2 Mar 2006 07:41:12 -0000 Received: (qmail 9015 invoked by uid 22791); 2 Mar 2006 07:41:12 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 02 Mar 2006 07:41:10 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k227f41a025965; Thu, 2 Mar 2006 08:41:04 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k227f3ul025964; Thu, 2 Mar 2006 08:41:03 +0100 Date: Thu, 02 Mar 2006 07:41:00 -0000 From: Jakub Jelinek To: "David S. Miller" Cc: libc-hacker@sources.redhat.com Subject: Re: check-textrel Message-ID: <20060302074103.GM30252@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek References: <20060301.201200.62138935.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060301.201200.62138935.davem@davemloft.net> User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00015.txt.bz2 On Wed, Mar 01, 2006 at 08:12:00PM -0800, David S. Miller wrote: > > I just noticed the elf/check-textrel test is failing on > sparc. It complains because the third segment of all the > shared objects are writable and executable. > > This turns out to be the .tdata section. > > LOAD off 0x0014e478 vaddr 0x0015e478 paddr 0x0015e478 align 2**16 > filesz 0x00004984 memsz 0x00007268 flags rwx > ... > 17 .tdata 00000008 0015e478 0015e478 0014e478 2**2 > CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL > > Probably some binutils issue? Actually, SPARC ABI issue. On i?86/x86_64/etc., there is a separate .got.plt section (writable, non-executable) and .plt section (non-writable, executable), on ppc32 there used to be the same thing as on SPARC, i.e. .plt is both writable and executable, ld.so changes instructions in .plt rather than some pointer that .plt insns use, but now we have -msecure-plt alternative which is also W^X. Ulrich added the W^X test to elf/check-textrel for security reasons, but I guess we just should have a whitelist of architectures that are known with their ABI to be !(W^X). sparc/sparc64/(ppc32 if not using -msecure-plt)/alpha/ at least. i?86/x86_64/ppc64/s390/s390x/arm/cris/sh are ok. Jakub