From patchwork Wed Apr 18 13:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133624 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5893887ljb; Wed, 18 Apr 2018 06:42:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx496p1QCcVgvRzSLQKpYTeOSDizBtjLkwYdKHcVwxk90VOvRQUqY3zOjUHGWmB2K/M6oc62E X-Received: by 10.80.234.195 with SMTP id u3mr3244549edp.49.1524058922017; Wed, 18 Apr 2018 06:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524058922; cv=none; d=google.com; s=arc-20160816; b=qxxwDzVKin8T0PMxcVb4gApzX+2NT3RP1nlGYAK8PYMDcn3sWBw44bkFaiqKCEX+zr 7rhy//tYxIioXsNHm3wEMUdE8RLp3h6KBlSpUv/aRdKSvyN0+GbooeUClO3rXT+k2gHJ Hk46GUI2Ag0kITbDbQ6aRMoOdDOi7hUSpKSFADfX22faO2u+cwDlx0iokCLW/dxJo8QW qHNhB2wSgJwjBUtrJ9blAideiii1ao9HzTlOux0aBBm4l996zaCM2aZDUBmLVR4dgZnm 2alTRCCRPQttE3TKMKrSxH2cH6M9N6ummBNGePqrXu7cq6n5k9F8PPSx9Ky5/IVGw//j 62cQ== 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=0yK4YFkGvkF40iKXKmj/tFFk9Cmd5xbyxEtwvG9701l8hjz5PIN8TiSfsl7CqNJPGt HmCkBfVH1PGHlMdXwCXL3tO3fofqX3UGMsUCvH3Pzln95RDCcdrDhl08W8NukAFte34D 3hvoDTplQHoTIk/BYgs3CUnDZ5Fto/wk0QrLqU8fGKytjYxMUCZ+DwdTsxKVyXBcWL/i ZxbTbAGISQcz4wdIlF8LFJP4btoUwPstJpHibND4GGLFlyNEZvUFeQmQAvBHN8CdRKes 6fpIpzThuu5mBAG9FD6v2VgyVZPaTZD5b53behsxIKH9xuRCOZuk1ebtHrSoudQeX2Lt 3wXw== 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 r11si337428edc.362.2018.04.18.06.42.01; Wed, 18 Apr 2018 06:42:02 -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 9756FC21E30; Wed, 18 Apr 2018 13:41:16 +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 47BA0C21EC9; Wed, 18 Apr 2018 13:40:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5A472C21DD4; Wed, 18 Apr 2018 13:40:34 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id A2DB2C21C8B for ; Wed, 18 Apr 2018 13:40:33 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F2A99AB1E; Wed, 18 Apr 2018 13:40:32 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Wed, 18 Apr 2018 15:40:24 +0200 Message-Id: <20180418134030.55127-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180418134030.55127-1-agraf@suse.de> References: <20180418134030.55127-1-agraf@suse.de> Cc: Heinrich Schuchardt , Greentime Hu Subject: [U-Boot] [PATCH 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 --- 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