From patchwork Thu Apr 19 15:49:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 133837 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp793412ljf; Thu, 19 Apr 2018 08:54:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx49+AyoEOVmp4inMWC4DI2tXhfDXbtpD0iEctwMnbhi2MaI50MQRpnKWLN/JbiTClV+o2iTR X-Received: by 10.80.189.195 with SMTP id z3mr9299114edh.207.1524153297543; Thu, 19 Apr 2018 08:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524153297; cv=none; d=google.com; s=arc-20160816; b=L1eCRngh+4G8coNadAzztqrCGX+CxhPTfod8kfONEf66+C8X4rh9V4A81zkL4A3UVr cSWrKEo3MmaZJzWyNTTLqaGQ709Vix4iMthoZphZ7q+t4hnGBvCU+sLRglfW0uuUliWn 8Y/hgIDe2r0CFKldP+bW9vtobooiImcOqsZYSwKVb2c66k59331D905SUeyuoUQkJrMF 43TSoYdu26ecoi+v+TLJh1zRJPNIJxTd+zhZvkWa3BKVzv5J2HAIB0nk4jCtXVmg6xDC Rh0rPIEYpTHYSSPpkjXxyclbLMPM/sdcyEOkBnyoz0f4O+3Xf7KoVBvApgBr42VsChz+ wXPw== 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=0SrQWIzVdic79od39djvKCZbWpuGNgkAxvaPppNZnkOuqGTT2MKpGmva/G2UeY9MiZ uD8blDlhz3FJEfjtGJKCzlPWsBpayV8m855bo3D50NccWsCmFNQlaYngJyK8FAe0BpcZ dE2ty3558+BUJ2mX23SURYs6fYy8bp4ts/g6y4cxEXUir8gLFIIawR3VZePpX71maZcq dwC1Ixe4NI1BfGfksKhxoCekk7gtrsmsHK7Kh3ZSGsuA6F1t4p7hF4MvcMBbYNdpS5ay 2f6XE5LNjO8qBnx1x9ObCU1TH9MOPuuDxCqIttK1a1IRZ+VSkQspaS9ypbG6WZ6yYSpc FSfA== 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 d13si3472541edi.154.2018.04.19.08.54.57; Thu, 19 Apr 2018 08:54:57 -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 2C1EDC22008; Thu, 19 Apr 2018 15:51: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 DB2DCC2200E; Thu, 19 Apr 2018 15:49:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8F815C21D8A; Thu, 19 Apr 2018 15:49:27 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id B3AE3C21F8F for ; Thu, 19 Apr 2018 15:49:25 +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 2209BAF79; Thu, 19 Apr 2018 15:49:25 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 19 Apr 2018 17:49:17 +0200 Message-Id: <20180419154923.70719-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180419154923.70719-1-agraf@suse.de> References: <20180419154923.70719-1-agraf@suse.de> Cc: Heinrich Schuchardt , schwab@suse.de, Greentime Hu Subject: [U-Boot] [PATCH v2 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