From patchwork Mon Apr 23 05:59:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133956 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp618770lji; Sun, 22 Apr 2018 23:05:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx481k7GVOm6R7o93sUcYVkrxmYxp+BLk2Teyt5Dp47r/6+NY+G0xVsQLSNShy/6YQlu0nsSF X-Received: by 10.167.212.137 with SMTP id b9mr12152305edr.121.1524463508363; Sun, 22 Apr 2018 23:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524463508; cv=none; d=google.com; s=arc-20160816; b=c/9i+UlrlzLMqwM31iLGZsR+6JwI6ZZvAjtMSHqWnD6BTOaZeO3vdfoxml6QDIMDez fY00jZtc6gs6PokBhkHf5AuaTtyziq+7LNIKi+EP1WoT7Y63O3GqHwSn37i8a1OV9T3j XvWeV5QkniedLsLjZux+2bAdqHOIeVv1e8wQCzTroKVzgE0VixQfuJ9xAIXXNEo+fBog YI2odvdSdOr8aFe4JDwQZE1/sAglTUBRmuf0/+uQMNuzW/yAJbmZhoY2c79kRTVg7DiK /KTZroTqfDyB8rfoOoMp8H4Iaeit+BHba5Y/IigiI2yVny3TNhV4a1hyiMA4fuZk9LpC 8sTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=HkE7PgZzxlAabLS5GdFfEUunbVRUidOklEb/dM3CVaU=; b=U7WR3sb+BXOvfIEve3vr3Kyw3iMnoIxE+qT/pnVGxiVeZgt2etFweSCFOeMC371ePN eMEPC+grwZ5OhuOHYOQbFTkMxWewyYb6gHX43X58m5mY9Jar+KeLLulm339nIz0wTItc h4J+P+S1O6FlWnmmIN4X5TcrsBBy3+5vtcA5/wImnT3OxGhgnlr7lD/l2mKUpRPWSHwh RUSPZ1AlNf7gxdn0LB1k4hauJ3wU7Id7ZEMtHv1cicVXB2s3c0Df0leSV7aNAXk8tRXd vjf7DS4y6pxxrsDUeVvx0vhd0y1kga0dlzEaa/nycMezwqpJPrphT1yq32UFvdOQyPp8 T9gQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r11si258890edc.362.2018.04.22.23.05.07; Sun, 22 Apr 2018 23:05:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id C26BFC21DF8; Mon, 23 Apr 2018 06:02:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4F59AC21E30; Mon, 23 Apr 2018 06:00:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8C1D4C21D8E; Mon, 23 Apr 2018 05:59:51 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 9108CC21DFB for ; Mon, 23 Apr 2018 05:59:51 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 58027ADA9; Mon, 23 Apr 2018 05:59:51 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Mon, 23 Apr 2018 07:59:44 +0200 Message-Id: <20180423055950.78818-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180423055950.78818-1-agraf@suse.de> References: <20180423055950.78818-1-agraf@suse.de> Cc: Heinrich Schuchardt , schwab@suse.de, Greentime Hu Subject: [U-Boot] [PATCH v3 2/8] riscv: Enable function sections X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The linker can remove sections that are never addressed, so it makes a lot of sense to declare every function as an individual section. This reduces the output U-Boot code size by ~30kb for me. Signed-off-by: Alexander Graf Reviewed-by: Rick Chen --- arch/riscv/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk index 6b681c4286..69f4cf6ce8 100644 --- a/arch/riscv/config.mk +++ b/arch/riscv/config.mk @@ -29,5 +29,5 @@ CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \ -T $(srctree)/examples/standalone/riscv.lds PLATFORM_CPPFLAGS += -ffixed-gp -fpic -PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 +PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections LDFLAGS_u-boot += --gc-sections -static -pie