From patchwork Sat Jan 27 03:57:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 866693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-89663-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="hHhRhx79"; dkim-atps=neutral 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 3zT27874vRz9t5Q for ; Sat, 27 Jan 2018 14:58:12 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:date:message-id:in-reply-to:references :cc:from:to; q=dns; s=default; b=Re/1czoRdrKhuepZg7XIwuYzIyCs905 sGcEp1qf+5JoC41u4x7EC4Gq2UCdOF+jycajOso+4ImfLLHghqyAEntQD5F9U5HR jRUfkkHor+0ixQdxfOSXdkKrDQy1BGPX87RTZp3Knk1tGMYbKyPFBJFsD1SJ5ngl oTfCcc7KiaCg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:date:message-id:in-reply-to:references :cc:from:to; s=default; bh=I9cNtrDPsAWoVoD5TZzAtX6Nl90=; b=hHhRh x79b35GdXK97avZeOp3WLfTaeIOE6O9+sTp38CEEB7iBT4KK/imIURqxl5u6NFoa 1UVMchcDbaigRtVVZgcbBW7j+WTS5b63o3qqPHlMt6BYJUIeB+GkLWFMJJHvnj4/ r8ZBMU1q4oCt+1AasHwthePNqFaeK0A6HZJY2w= Received: (qmail 103130 invoked by alias); 27 Jan 2018 03:57:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 103062 invoked by uid 89); 27 Jan 2018 03:57:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:sk:mail-pl, HX-HELO:sk:mail-pl, H*r:sk:mail-pl, H*RU:sk:mail-pl X-HELO: mail-pl0-f44.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :cc:from:to; bh=I3kk1kwiBRxbSRVbXkKbGaS2UKw773N1+iMm3IYhUok=; b=jfBp24R82Yq8ddm8bohhAJEqNFaR+xg5XoNo60j6GtxIWuV7PS4Ewb63Y+Rzl5i1B7 2CDVudU06bDM+SikdRnz3Uu/04pszWasRh4JwLEzxg/A+kgiziOPdKF6kzAzjI/MQ48/ w44tTLmjPiIso49k9GR4kEDyEj9fs9IB+CXFCtGsmeriBr7rAnDWZYJJmfavfm5groHC KfoxvU1RJdXzCVelXxJCGQ90jQoBzg54+7whZdpfkHN9ydWYRy6IIGvr0/tUPovm6kpT kSyotBJvwVCZOM4pQ8DGgUUm/bOnyOx13M7jTUyxnu0ULu6cfTMKCc3oWN4mbpWBt0mx rDBA== X-Gm-Message-State: AKwxytcgxkD0nQ6dOaZFT4N63s39DGTMnpGXJJiN80PAnSsoMZK7jiwx qVjeunzMSXHIOl4YlZNZqZpnSA== X-Google-Smtp-Source: AH8x22661DzbEfsqYytxJ2MM5KAjXJpS10ehmn3HuDc2SJy0gIL0lMtI23uwF4HkBCvm8C1IaApAUA== X-Received: by 2002:a17:902:8f90:: with SMTP id z16-v6mr16283016plo.370.1517025475458; Fri, 26 Jan 2018 19:57:55 -0800 (PST) Subject: [PATCH v7 01/17] sysdeps/init_array: Add PREINIT_FUNCTION to crti.S Date: Fri, 26 Jan 2018 19:57:28 -0800 Message-Id: <20180127035744.10058-2-palmer@dabbelt.com> In-Reply-To: <20180127035744.10058-1-palmer@dabbelt.com> References: <20180127035744.10058-1-palmer@dabbelt.com> Cc: Palmer Dabbelt From: Palmer Dabbelt To: libc-alpha@sourceware.org, joseph@codesourcery.com The RISC-V port contains a crti.S that simply contains a link to PREINIT_FUNCTION (when defined). As this should be entirely generic, Joseph Myers suggested that we update the generic init_array version to contain this. Since RISC-V is the only user of init_array this won't break any existing ports. 2018-01-26 Palmer Dabbelt * sysdeps/init_array/crti.S (.section .init_array): Add PREINIT_FUNCTION when defined. --- sysdeps/init_array/crti.S | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sysdeps/init_array/crti.S b/sysdeps/init_array/crti.S index 0a6e9fd95338..145c918f939b 100644 --- a/sysdeps/init_array/crti.S +++ b/sysdeps/init_array/crti.S @@ -11,3 +11,17 @@ But new configurations without compatibility concerns for toolchains without .init_array support can use this to avoid the superfluous .init and .fini boilerplate code. */ + +#ifdef PREINIT_FUNCTION + +#if PREINIT_FUNCTION_WEAK +# error PREINIT_FUNCTION_WEAK is unsupported +#endif + +/* This arranges for PREINIT_FUNCTION to be called upon loading a library that + contains crti.o. */ + + .section .init_array,"a",%init_array + .dc.a PREINIT_FUNCTION + +#endif