From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 888691F8C6 for ; Sat, 31 Jul 2021 17:10:36 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 816D03854813 for ; Sat, 31 Jul 2021 17:10:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 816D03854813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627751435; bh=HbDPvMURIXDmOsSHKYxzdaAGLvuSftKV/90E+da67ss=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y26JpsZoC0K+si4LfEJgIkWUn6K3+7gwxPRaLFl3+AZ/RhPA0mFnUg3YF7DV6rygc og7f21qnxgV2PlM9B/a4Vie0BLB44mCdY6SiZ+in1awF/tXsIGCO9Ex6LWgw3hn+wg w6mZvfHmsiGCwXr4k057/5VWNJ310dQq2SgVAZhA= Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 9AAA43858D3C for ; Sat, 31 Jul 2021 17:10:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9AAA43858D3C Received: by mail-pj1-x102a.google.com with SMTP id pj14-20020a17090b4f4eb029017786cf98f9so8233288pjb.2 for ; Sat, 31 Jul 2021 10:10:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HbDPvMURIXDmOsSHKYxzdaAGLvuSftKV/90E+da67ss=; b=auEMg31THA0jhVLWO9c2C16KAQ8aNI4jkuJ7T/bf0hLX8t1/+DsngPGcFpEmrwszU8 jWApAP1auKz68X+UsFRzaxOhPsB1XJl1tFkeePWP08n+L3v9qgsC1ypE9SyapG8V+Zxa wcddCTrGPZ94R+xHCkuZEQ/1SdKihO2oyMAMDQt95PpGzBwhGVN7xZoH63RDpapdxMyH CMadjTzg07JIUQpaAol90kKpIy5uHn94G0zFeoQDo85m9HoySNN15sfO1ux+G1bcY/Vr PHM5anr+gkgnpQTEj4P/P7Chkgr+rNb/vRm1vY6iiswLSs/Cf3dty/gwpxco8oer6kxv rdWA== X-Gm-Message-State: AOAM530JQA2cm8MP3o2BcvFFYJyensy3zzrl61AzIVmiruWC2rmrS//S 7zuF4qX1gH7dprFKLyYVR9GiatKCxg4hcuBNExI= X-Google-Smtp-Source: ABdhPJxsZ4FWuFyTal8S/42fZ8fx4R0r5bz22eEwVc0H8nr+fBjoJdSx0pSej8R7IY5Q6gIkpIJ8/0oVwmtn4m9QL3k= X-Received: by 2002:a65:5083:: with SMTP id r3mr2684227pgp.161.1627751414689; Sat, 31 Jul 2021 10:10:14 -0700 (PDT) MIME-Version: 1.0 References: <20210731151316.1659316-1-hjl.tools@gmail.com> <87o8aiv3sl.fsf@oldenburg.str.redhat.com> In-Reply-To: Date: Sat, 31 Jul 2021 10:09:38 -0700 Message-ID: Subject: Re: [PATCH v2] Place ENTRY_POINT in .text.unlikely section [BZ #28153] To: Florian Weimer Content-Type: text/plain; charset="UTF-8" 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: , From: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Cc: "H.J. Lu via Libc-alpha" Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Sat, Jul 31, 2021 at 10:06 AM H.J. Lu wrote: > > On Sat, Jul 31, 2021 at 9:36 AM Florian Weimer wrote: > > > > * H. J. Lu via Libc-alpha: > > > > > diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S > > > index 417da8802b..e46e01ed0b 100644 > > > --- a/sysdeps/aarch64/start.S > > > +++ b/sysdeps/aarch64/start.S > > > @@ -42,7 +42,7 @@ > > > NULL > > > */ > > > > > > - .text > > > + .section .text.unlikely,"ax",%progbits > > > ENTRY(_start) > > > /* Create an initial frame with 0 LR and FP */ > > > cfi_undefined (x30) > > > > I don't think it's correct to place code that runs during every process > > start into .text.unlikely. Surely we can avoid that page fault. > > > > Can we fix the ENTRY_POINT assumption in profiling instead? > > We can do > > diff --git a/csu/gmon-start.c b/csu/gmon-start.c > index b3432885b3..83322fd586 100644 > --- a/csu/gmon-start.c > +++ b/csu/gmon-start.c > @@ -48,7 +48,7 @@ > #ifdef ENTRY_POINT_DECL > ENTRY_POINT_DECL(extern) > #else > -extern char ENTRY_POINT[]; > +extern char entry_point[] asm (__SYMBOL_PREFIX "main"); > #endif > extern char etext[]; > > @@ -56,7 +56,7 @@ extern char etext[]; > # ifdef ENTRY_POINT_DECL > # define TEXT_START ENTRY_POINT > # else > -# define TEXT_START &ENTRY_POINT > +# define TEXT_START &entry_point > # endif > #endif > > But this may only work with BFD linker which places .text.startup > section before .text section. Another option is to place _start in .text.startup which leaves *(.text.unlikely .text.*_unlikely .text.unlikely.*) *(.text.exit .text.exit.*) sections out of profiling records. -- H.J.