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=-1.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, MAILING_LIST_MULTI,PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 8E2471F8C6 for ; Fri, 6 Aug 2021 00:16:38 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 53EB13848030 for ; Fri, 6 Aug 2021 00:16:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53EB13848030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628208997; bh=+OxAriTt9Zg7YeMmWjg9hqwBVj3TpF22l70XlDwOKt8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=f9KWx4XcKcN2yfvhceP5kyo8otzI5QhlnXMTn/tG5rsNfw0yIb6aIqgELplidx5/R PSUAagVH34hMSb/CSPByBsYS+zYNWzXHyIJPrI5GYE3XQfhwV0rCfPZxt6pF8Oxbs9 t9pKLh6+hhNEhRW8/kqiEvyj+/tUF3fSwagJr0rE= Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 452643851C31 for ; Fri, 6 Aug 2021 00:16:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 452643851C31 Received: by mail-pj1-x1033.google.com with SMTP id t7-20020a17090a5d87b029017807007f23so15804364pji.5 for ; Thu, 05 Aug 2021 17:16: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:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+OxAriTt9Zg7YeMmWjg9hqwBVj3TpF22l70XlDwOKt8=; b=eSUOewpgAsk/bMvGqPkeQcHO/S9matV4ZQm0uiA38LlDKgZQD6OcXXzMOW0j0JQRB9 1h++PZ7dhGC3joaCBAc1FDx1VhI9pwXmN5o2tB8zPZ1FIGuTtHj5mT6tgKE8UdJPX9hf eK77bPTadK9TXOjmEdRU+cgv8w86jRj7YWO2YVA8bNT2f75blFY5yslzrATy3KOesHSK I4krgjon3GzcX1Qjoqbgx5SgSWxFDGOcJQk05YMCDjKRX6TIMnGwOOeH1OrORc3IOQuh AKr80eDVyg1sbUq8KiI1z2H/PsC6zIoMMiVo5yqPur2y5roiogN4V2ymvdMa9QTcrQkd ZPfw== X-Gm-Message-State: AOAM533hSGmce/cfM4WNYcWQP5AeRsji3RPKrL4dDwrOELm90ZH86k6a EElBsBqFk2YuRRLy/iq9hmi3xA== X-Google-Smtp-Source: ABdhPJwWVAoqwkyaT095nZd+9dhOW/Ko+D2znXzXuUs12ftfOGcT7UFsaXe2sgSMDhgE9l2K18l5fA== X-Received: by 2002:a05:6a00:16d6:b029:32a:ffe9:76a with SMTP id l22-20020a056a0016d6b029032affe9076amr7861321pfc.60.1628208974211; Thu, 05 Aug 2021 17:16:14 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:6668:5d25:689f:8ff1]) by smtp.gmail.com with ESMTPSA id y139sm8102189pfb.107.2021.08.05.17.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 17:16:13 -0700 (PDT) Date: Thu, 5 Aug 2021 17:16:09 -0700 To: "H.J. Lu" Subject: Re: [PATCH v3] Use __executable_start as the lowest address for profiling [BZ #28153] Message-ID: <20210806001609.x5q2zkhoo7xeaf3c@google.com> References: <20210805120904.3528530-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210805120904.3528530-1-hjl.tools@gmail.com> 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: Fangrui Song via Libc-alpha Reply-To: Fangrui Song Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 2021-08-05, H.J. Lu via Libc-alpha wrote: >Glibc assumes that ENTRY_POINT is the lowest address for which we need >to keep profiling records and BFD linker uses a linker script to place >the input sections. > >Starting from GCC 4.6, the main function is placed in .text.startup >section and starting from binutils 2.22, BFD linker with > >commit add44f8d5c5c05e08b11e033127a744d61c26aee >Author: Alan Modra >Date: Thu Nov 25 03:03:02 2010 +0000 > > * scripttempl/elf.sc: Group .text.exit, text.startup and .text.hot > sections. > >places .text.startup section before .text section, which leave the main >function out of profiling records. > >Starting from binutils 2.15, linker provides __executable_start to mark >the lowest address of the executable. Use __executable_start as the >lowest address to keep the main function in profiling records. This fixes >[BZ #28153]. > >Tested on Linux/x86-64, Linux/x32 and Linux/i686 as well as with >build-many-glibcs.py. >--- > csu/gmon-start.c | 10 +++++++++- > gmon/tst-gmon-gprof.sh | 2 ++ > gmon/tst-gmon-static-gprof.sh | 2 ++ > 3 files changed, 13 insertions(+), 1 deletion(-) LGTM