From patchwork Wed Oct 19 22:38:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 78353 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp488220qge; Wed, 19 Oct 2016 15:38:48 -0700 (PDT) X-Received: by 10.98.58.73 with SMTP id h70mr15453494pfa.138.1476916728759; Wed, 19 Oct 2016 15:38:48 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w189si39010556pgd.115.2016.10.19.15.38.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 15:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-439067-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-439067-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-439067-patch=linaro.org@gcc.gnu.org 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 :content-transfer-encoding; q=dns; s=default; b=o06KRs3DFgvf0Ju0 Yk8jsc6ButgxEoivrDLOwPJ2Z1TT8JPp169pbQx8PkxEddiZD2K1sF1uQiwHDUSe ZLsA2Op10bliNpPG+91ULNcuwYDNYeQ3Fyh4DtdI3M5v9ietn/eeDwAeBBO6Xx2R VLAulausDsEVNY3clKsRRpCNq3Y= 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 :content-transfer-encoding; s=default; bh=fk9hV8D40hFVMmewZkbUqG GZOno=; b=KId+cKgxCrBPXQWMK6iR8COeJk5u89Fd7wZhDJclNGS3uHihVwp4j5 f6y5tYrMVBEDo/4h/QXe2C6nL9YuK3AJ9R8GJddS2fLwjpj6FKl8yAsh5ic0vsYi 1Nu29Z23pO4oJ1xwZnhGa83oOyqxDvM9cJYjr5rtpk2UicMqW8uvE= Received: (qmail 121664 invoked by alias); 19 Oct 2016 22:38:38 -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 121647 invoked by uid 89); 19 Oct 2016 22:38:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=2206, 220, 6, Hx-languages-length:1840, uintptr X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Oct 2016 22:38:27 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1D10981308 for ; Thu, 20 Oct 2016 00:38:25 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TF-Fd8BLPeM1 for ; Thu, 20 Oct 2016 00:38:25 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id ECA00812FF for ; Thu, 20 Oct 2016 00:38:24 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [libgo] Remove unused declarations in runtime.h Date: Thu, 20 Oct 2016 00:38:24 +0200 Message-ID: <2295664.zC7BSugLvC@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-42-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Hi, linking any Go program on SPARC/Solaris with the GNU assembler and the Sun linker yields a warning: ld: warning: relocation error: R_SPARC_UA32: file /sydney.a/users/botcazou/gcc-head/sparc-sun- solaris2.10/./libgo/libgobegin.a(libgobegin_a-go-main.o): symbol runtime_startup_random_data: external symbolic relocation against non- allocatable section .debug_info; cannot be processed at runtime: relocation ignored It's because (almost) every C file in runtime/ includes runtime.h, which has these lines: byte* runtime_startup_random_data; uint32 runtime_startup_random_data_len; void runtime_get_random_data(byte**, int32*); which cause (almost) every object file to have the first 2 as common symbols and this runs afoul of some limitation of the Sun linker. Now there seem to be no other references to these 3 objects in the libgo directory and removing them doesn't seem to change the behavior of the Go compiler so the attached patch does just that. Tested on x86_64-suse-linux and SPARC/Solaris, OK for mainline? 2016-10-19 Eric Botcazou * runtime/runtime.h (runtime_startup_random_data): Delete. (runtime_startup_random_data_len): Likewise. (runtime_get_random_data): Likewise. -- Eric Botcazou Index: runtime/runtime.h =================================================================== --- runtime/runtime.h (revision 241326) +++ runtime/runtime.h (working copy) @@ -220,10 +220,6 @@ extern bool runtime_copystack; #define USED(v) ((void) v) #define ROUND(x, n) (((x)+(n)-1)&~(uintptr)((n)-1)) /* all-caps to mark as macro: it evaluates n twice */ -byte* runtime_startup_random_data; -uint32 runtime_startup_random_data_len; -void runtime_get_random_data(byte**, int32*); - enum { // hashinit wants this many random bytes HashRandomBytes = 32