From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id B49AE3858C51 for ; Mon, 2 May 2022 20:07:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B49AE3858C51 Received: by mail-pj1-x102f.google.com with SMTP id e24so13581478pjt.2 for ; Mon, 02 May 2022 13:07:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FEkRQ4uQ6sccwVqMgai+XgMoIF/Rr7tsS/s9xE7udkM=; b=zc3zv7hSBOPlotTeyaWwII+jnztC/s7/oU9kXTXz2mpF6S1qxLxzIxwT2k6etXCdFe qcQHoTKpLe7UZ8MQcXW5DQ93Umws/UdqpDjn4j8ixCVngYEGGgzozsma388Bt/baNwXI oj4+qfu/FPtt2OjS1D/hjVZcUc+FS+JJ9tEkEVP13uWAgDLaiETqxXkN3RCwfio64+9G YrCzGGtI/FWGVFfIKsWyz98+QNnnXYGkpENO7QYNErI/FwI1c4iwkPlIyMPnYfTCZj1m upxnbIOiSJ1UR8bcekclRxh5Q5PhMaA8AorqeR/cNSsXue7EY6gpNtBPIcpqxuPeNido 0jWQ== X-Gm-Message-State: AOAM530ew3tY0AQ98DiaTTegO0p+ybqsYyiDUwd72okKtnZUwKoaPC2y zMmVKo+FYbhgMySSQEy+ah/B7bhw3FFLtFLOxSw= X-Google-Smtp-Source: ABdhPJw/GEUmU6j+z4ADO+fEpyS7nKtUVZ9NImLiKWfwtd3JXSAYDu4M4m7CrdrjGJa93jL/7wo7FPNn9BfCiK88kQI= X-Received: by 2002:a17:90b:1b44:b0:1dc:315f:4510 with SMTP id nv4-20020a17090b1b4400b001dc315f4510mr939236pjb.28.1651522053802; Mon, 02 May 2022 13:07:33 -0700 (PDT) MIME-Version: 1.0 References: <7a6a51b346a81484046ba392a9854a88568a92aa.1651518694.git.fweimer@redhat.com> <87ilqn4spx.fsf@oldenburg.str.redhat.com> In-Reply-To: <87ilqn4spx.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 2 May 2022 13:06:57 -0700 Message-ID: Subject: Re: [PATCH 1/5] Linux: Implement a useful version of _startup_fatal To: Florian Weimer Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 20:07:36 -0000 On Mon, May 2, 2022 at 12:53 PM Florian Weimer wrote: > > * H. J. Lu: > > >> +#include_next > >> diff --git a/sysdeps/unix/sysv/linux/startup.h b/sysdeps/unix/sysv/linux/startup.h > >> new file mode 100644 > >> index 0000000000..a5de941759 > >> --- /dev/null > >> +++ b/sysdeps/unix/sysv/linux/startup.h > >> @@ -0,0 +1,38 @@ > >> +/* Linux definitions of functions used by static libc main startup. > >> + Copyright (C) 2017-2022 Free Software Foundation, Inc. > > Shouldn't it just be 2022? > >> + This file is part of the GNU C Library. > >> + > >> + The GNU C Library is free software; you can redistribute it and/or > >> + modify it under the terms of the GNU Lesser General Public > >> + License as published by the Free Software Foundation; either > >> + version 2.1 of the License, or (at your option) any later version. > >> + > >> + The GNU C Library is distributed in the hope that it will be useful, > >> + but WITHOUT ANY WARRANTY; without even the implied warranty of > >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > >> + Lesser General Public License for more details. > >> + > >> + You should have received a copy of the GNU Lesser General Public > >> + License along with the GNU C Library; if not, see > >> + . */ > >> + > >> +#ifdef SHARED > >> +# include_next > >> +#else > >> +# include > >> + > >> +/* Avoid a run-time invocation of strlen. */ > >> +#define _startup_fatal(message) \ > > > > Is this needed only for static PIE? > > I don't know. It's used from csu/libc-tls.c, some targets may need it > for ET_EXEC static linking, too. I haven't checked. The additional > code size is minimal. _startup_fatal was added for i386 static PIE. I don't think it is needed for normal static executables. -- H.J.