From patchwork Sun Jul 22 15:04:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 172518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 05ACA2C0131 for ; Mon, 23 Jul 2012 01:04:28 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343574269; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Date:Message-Id:From:To: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=FJeI4WUUiuiajEdDM10t VKxsWz0=; b=kI3tkIBEwuYvuKOSBFztTg4czZ25pEfqnRBXjYbCYr3jWcgkUDkB ZgusY4ri15CvvGAp8/DcJNDXOYwzsxRLpnVYkEX0fzKQWMn2oITZejCn5i/Ql/yT vy7uJU3aU4xC9u/1OmA0bfrh/0IutmQtOb47JvsM95TZlDaoC4ek6L0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:Received:Date:Message-Id:From:To:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VWI6F6CtnBTkE8zmWCXoVhHJMZgue3bN+uzFMPE2oB8FLCAjdCNyujrod1jT8y iEOr+ih0yOrHdegZWCxPwEwRMoPf6ElKJ1rYZBG6oV7RD78uOrs2WnItCmG2lLRr GMh/ZuQc95j8ELhHaoBWAJQq8Ch+zAlDqFhIN63R50M8k=; Received: (qmail 28640 invoked by alias); 22 Jul 2012 15:04:25 -0000 Received: (qmail 28627 invoked by uid 22791); 22 Jul 2012 15:04:24 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from anubis.se.axis.com (HELO anubis.se.axis.com) (195.60.68.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jul 2012 15:04:08 +0000 Received: from localhost (localhost [127.0.0.1]) by anubis.se.axis.com (Postfix) with ESMTP id CD38E19E07 for ; Sun, 22 Jul 2012 17:04:03 +0200 (CEST) Received: from anubis.se.axis.com ([127.0.0.1]) by localhost (anubis.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id b-RBB897hmDq for ; Sun, 22 Jul 2012 17:04:03 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by anubis.se.axis.com (Postfix) with ESMTP id 3053619DF9 for ; Sun, 22 Jul 2012 17:04:03 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by thoth.se.axis.com (Postfix) with ESMTP id 1E44C340B8; Sun, 22 Jul 2012 17:04:03 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id q6MF42d0025954; Sun, 22 Jul 2012 17:04:02 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id q6MF42L9025950; Sun, 22 Jul 2012 17:04:02 +0200 Date: Sun, 22 Jul 2012 17:04:02 +0200 Message-Id: <201207221504.q6MF42L9025950@ignucius.se.axis.com> From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org Subject: Committed: executable-stack note for CRIS MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Tested crisv32-linux (much as you can do without actually installing a new /lib/ld.so.1 with the changed defaults). Yep, this is actually a change of the default in glibc (port to be submitted), but changing it this way is safe: with old libraries lacking a note, they default to not having an executable stack, as should be. You pragmatically only need an executable stack for the gcc test-suite, AFAIK. :) Committed. Tested cris-elf and crisv32-elf too with some other patches FWIW. Emit executable-stack note correctly for CRIS targets. * config/cris/cris.c (cris_file_end): New function. (TARGET_ASM_FILE_END): Define. brgds, H-P Index: config/cris/cris.c =================================================================== --- config/cris/cris.c (revision 189754) +++ config/cris/cris.c (revision 189755) @@ -153,6 +153,7 @@ static void cris_trampoline_init (rtx, t static rtx cris_function_value(const_tree, const_tree, bool); static rtx cris_libcall_value (enum machine_mode, const_rtx); static bool cris_function_value_regno_p (const unsigned int); +static void cris_file_end (void); /* This is the parsed result of the "-max-stack-stackframe=" option. If it (still) is zero, then there was no such option given. */ @@ -199,6 +200,8 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_ #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START cris_file_start +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END cris_file_end #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS cris_init_libfuncs @@ -2747,6 +2750,17 @@ cris_file_start (void) default_file_start (); } +/* Output that goes at the end of the file, similarly. */ + +static void +cris_file_end (void) +{ + /* For CRIS, the default is to assume *no* executable stack, so output + an executable-stack-note only when needed. */ + if (TARGET_LINUX && trampolines_created) + file_end_indicate_exec_stack (); +} + /* Rename the function calls for integer multiply and divide. */ static void cris_init_libfuncs (void)