From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3r7m8K0kR8zDq68 for ; Tue, 17 May 2016 02:27:28 +1000 (AEST) Subject: Re: ppc64 sbrk returns executable heap in 32-bit emulation mode To: Andreas Schwab References: <5590cf46-aaa2-451e-f21d-acf5f2eb4928@redhat.com> <20160516062425.GA24091__32035.8907142237$1463379977$gmane$org@bubble.grove.modra.org> Cc: Alan Modra , linuxppc-dev@lists.ozlabs.org From: Florian Weimer Message-ID: <92af6d3d-b55e-af9d-4a71-2014490eeabd@redhat.com> Date: Mon, 16 May 2016 18:27:24 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 05/16/2016 11:09 AM, Andreas Schwab wrote: > Florian Weimer writes: > >> But my test says that at least part of .bss in the main executable is >> *not* executable. > > Build with -mbss-plt -Wl,--bss-plt. This gives me: FAIL exec .bss data (unexpected result) FAIL exec .data (unexpected result) FAIL exec malloc (small) (unexpected result) FAIL exec malloc (page size) (unexpected result) And this is somewhat expected: There is an RWX LOAD segment which covers .bss and .data, and it also overlaps with the heap. So maybe we can change the kernel heap default in case there is no RWX LOAD segment, so that most binaries get a non-executable heap? What do you think? Thanks, Florian