From patchwork Tue Jan 28 21:44:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 314846 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B3D1A2C00B2 for ; Wed, 29 Jan 2014 08:45:10 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=oE1ryznzbk+xXZBetVN7pVlP37UImRYA5SZ/YTipM+cFGVU+T6iJ8 OaeFriRbj6wqhmTeK3hyOdaU4NLAhrZ5vJQUQP24sOXW7SVTQS3XKmhKMGB3/cr7 zPyB7apEA3ZDg2/SZnQp5iOfa7NKIG6sCKmWlKWIj5J/wXatD4T8XU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=jP+a4TvnhmKPUuJ+xMGh27J1/XY=; b=BsYCYrzSOyRoEG/LP+70 Db1EJ+X1M+K6f3YKTX+QKwIunMDBuwdrHdRf3JoaodPT4sQRXDLSi0eOT+MmdlZ7 Du4C7HBADetNl6anHt6uo9VtXauVqp2EYCoUtBZKO0pSOeGx4Hsi+gH5p89Ifwid 5PRKLPfrTVyHqA+zTJT2Zms= Received: (qmail 29387 invoked by alias); 28 Jan 2014 21:45:04 -0000 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 Received: (qmail 29373 invoked by uid 89); 28 Jan 2014 21:45:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f172.google.com Received: from mail-pd0-f172.google.com (HELO mail-pd0-f172.google.com) (209.85.192.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 28 Jan 2014 21:45:01 +0000 Received: by mail-pd0-f172.google.com with SMTP id p10so856364pdj.17 for ; Tue, 28 Jan 2014 13:44:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=q3tXQFKkl+hvxamPUeuTCxmMRQhVbbjROWxxU2zDLFw=; b=XixkZNYL5m5DY0u1N7+RMpo7xhwg7WfdUS33G5KZv9qNZsZyQkwxkMMKQ8Z130RKKV CQU5JLDAbpSmGMWk8V5ugH27kjaiXmMdUi5Ccc/hN2kNHi5J0QUNebhq8qf/89PnZ0I7 AFuOA7uZsnXIsqzWcnFGdIgEsn7pDitd9EXKewzWICMShO03le36FGS4K2+Ry0SiRVuA uWE/9brdVjPLCNOR5rCgtu24JRAww+gGvFkfwTxF9AdJ8w9XzHTRD+3XlKX/hKTAWEdo saE1ndqRdDZRp3NGBpk/A2V6bDE5TuC69U1OKd5ZRa4bXMlxyjsnsl8dvSdeH/FbUX0I q1jg== X-Gm-Message-State: ALoCoQl0VO8jSP5mRcfEc/EeFdIAFlgiKfDuI9oAqnPWmNcdXXbQe1Zn942rb5MIOpIdgPFy8yS0KF6s3/bZIlGSatOLRXEfdgZ9rfP+mVc61wwkiElB7RWrMeByGYgYVn4n2EumutLRmnbk43TgMacs4QwkTBMRD1JLav/WMk0tzKFEBOnVd6h+ZY2k9BiK2LKcbLse9u+5L7hW8OFi9Ke6uVqDYtSB6g== X-Received: by 10.69.19.193 with SMTP id gw1mr3887817pbd.89.1390945499694; Tue, 28 Jan 2014 13:44:59 -0800 (PST) Received: from iant-glaptop.roam.corp.google.com.google.com ([2620:0:1000:3204:b5ed:9e83:af9c:73c7]) by mx.google.com with ESMTPSA id qw8sm18142pbb.27.2014.01.28.13.44.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 28 Jan 2014 13:44:56 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Put nointerface methods in unique sections Date: Tue, 28 Jan 2014 13:44:54 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes This patch to the Go frontend puts nointerface methods in unique sections. A method marked nointerface may not be needed in the final link, and putting it in a unique section makes it possible for the linker to discard it if possible. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r e6c55d1cd62b go/gogo.cc --- a/go/gogo.cc Fri Jan 24 14:47:58 2014 -0800 +++ b/go/gogo.cc Tue Jan 28 13:42:48 2014 -0800 @@ -4094,12 +4094,19 @@ // stack splitting for the thunk. bool disable_split_stack = this->is_recover_thunk_; + // This should go into a unique section if that has been + // requested elsewhere, or if this is a nointerface function. + // We want to put a nointerface function into a unique section + // because there is a good chance that the linker garbage + // collection can discard it. + bool in_unique_section = this->in_unique_section_ || this->nointerface_; + Btype* functype = this->type_->get_backend_fntype(gogo); this->fndecl_ = gogo->backend()->function(functype, no->get_id(gogo), asm_name, is_visible, false, is_inlinable, - disable_split_stack, - this->in_unique_section_, this->location()); + disable_split_stack, in_unique_section, + this->location()); } return this->fndecl_; }