From patchwork Tue Jun 8 23:12:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1489660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=nOPes8gO; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G05cy2W9xz9sCD for ; Wed, 9 Jun 2021 09:13:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 168D2398547C for ; Tue, 8 Jun 2021 23:13:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 168D2398547C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623193983; bh=yYZRCFUE6J4VX3JSgwtTDxMvUAaW8pw7qFSFKgK7/40=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nOPes8gOrSEQx4Qb/qzYE404v9hSf3sjbzmrIPlDxGmIdwuRgHAn1kJc9tCQipnMx JcUtjyavYTdoxUmMhyllH7hbS9VCVa9Yl1Lp6PVd5SxVd/nIGjBWBYBy6YBdaC5yHs VquXnxENm5RWEGMCh4GajiAUxq8ws8GvHWHoaFSA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id E3965398546C for ; Tue, 8 Jun 2021 23:12:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E3965398546C Received: by mail-pf1-x42b.google.com with SMTP id p13so7348477pfw.0 for ; Tue, 08 Jun 2021 16:12:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=yYZRCFUE6J4VX3JSgwtTDxMvUAaW8pw7qFSFKgK7/40=; b=LMFs8npvp9hwndIZdSiG7sUFX4vqWI2DfpgpLQ8RE7a5+rIWj68iXiwfrdiGSbm9Ov 8Jf7ocQde05X7PY39tgSLZ1G/IqEpDKzU1DubDclUc5mbZ6IagPd+wvYY+fRXZItOWM7 D+CRbyjXFCKxQeJlk89QUFHprR78f9+NYeWm2aVvuVR98rnmi38zzf8rI5ZTjJEhdwzk 9Fzpw3Tv+VMq/hBHjqPkL6RWfAAPheBPJB+JarNPtWgt1nAB6/Nta0EJlfoGSxCfUPyJ mkvfBEcw5WHO8Xq6u0pFeKewDDsPTwV/xVV0et3hDwslSnwo1uT1FzVSDSBHhcA1H31A cszg== X-Gm-Message-State: AOAM532jNcWqgzXy4ZEIUToh3GZp50cQTQv7DEoCOzzJ6idKnECybvyf tcJo/zW3qlbCvGO0xxi81OJOh1GjIU0= X-Google-Smtp-Source: ABdhPJxxqlKrQEWWITbhH0jbFDVaERp/ffODkHApuYRUDdD5SdvMURK0/6sj2mxGaPkJcGzz69AB3Q== X-Received: by 2002:a62:7f15:0:b029:2e9:c6b8:516d with SMTP id a21-20020a627f150000b02902e9c6b8516dmr2378323pfd.52.1623193939730; Tue, 08 Jun 2021 16:12:19 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.56.38.102]) by smtp.gmail.com with ESMTPSA id b6sm6995729pgw.67.2021.06.08.16.12.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 16:12:19 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 3E13BC006D for ; Tue, 8 Jun 2021 16:12:17 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Always enable DT_INIT_ARRAY/DT_FINI_ARRAY on Linux Date: Tue, 8 Jun 2021 16:12:17 -0700 Message-Id: <20210608231217.3845032-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3034.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" DT_INIT_ARRAY/DT_FINI_ARRAY support was added to glibc by commit fcf70d4114db9ff7923f5dfeb3fea6e2d623e5c2 Author: Ulrich Drepper Date: Sat Jul 24 19:45:13 1999 +0000 Update. 1999-07-24 Ulrich Drepper * elf/dl-fini.c: Handle DT_FINI_ARRAY. * elf/link.h (struct link_map): Remove l_init_running. Add l_runcount and l_initcount. * elf/dl-init.c: Handle DT_INIT_ARRAY. ... PR target/100896 * config.gcc (gcc_cv_initfini_array): Set to yes for Linux and GNU targets. --- gcc/config.gcc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config.gcc b/gcc/config.gcc index 6833a6c13d9..4dc4fe0b65c 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -848,6 +848,8 @@ case ${target} in tmake_file="${tmake_file} t-glibc" target_has_targetcm=yes target_has_targetdm=yes + # Linux targets always support .init_array. + gcc_cv_initfini_array=yes ;; *-*-netbsd*) tm_p_file="${tm_p_file} netbsd-protos.h"