From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 59ABD385DC15 for ; Tue, 20 Jul 2021 22:05:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59ABD385DC15 Received: by mail-pf1-x42c.google.com with SMTP id m83so743400pfd.0 for ; Tue, 20 Jul 2021 15:05:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=0iYJSjBr7z4BkBOM0orwYTNMuE+M3ZykCAM0IjdAGp4=; b=SoHY9e+xd7PXy8B91ueS7/96rTwJzkg5LmCzTC94EoB4wXB9N4J7E0jka5TQHl6nCy dkVA3UjUloT3ZW/3nrn84AUEHr3KCqy+c+RmPQy334VGbA7BrsKZlIKdo9yz3WXRdhmK A6+34S2YFmar6e7pPnKXu27v43YaPuPPHb5oBcoC7zcyfCSDrr4x3FXFmW6ujJ4eZaPo GoipnPC7GOx0DBfLcd61v9FTuMuxp8EJP16wh2mMjmAcjccLRxMs5RL8QD/t0iGQliq2 RNl4jF7BGuY367z2c+L0GwIiI8Ajrj7dXMiIAYxKajBUYf5chTXtVKfDJHGbSKUtQMVB N4oQ== X-Gm-Message-State: AOAM531NIofrOVczIGXlV/B4VtoxO1KdKnDEeYtRimMWJfbcw5RZevRw wItnnIft+n7tjZGqiNVT+9zOsPfKyyovhg== X-Google-Smtp-Source: ABdhPJw0egQB/6xNza1UhrAJ50cmmGqvI+Q0XiaaBUaee2cZg8QL85yz3piMwq8EAIXYTtN/fN89wQ== X-Received: by 2002:a65:6253:: with SMTP id q19mr32657775pgv.230.1626818706996; Tue, 20 Jul 2021 15:05:06 -0700 (PDT) Received: from [192.168.1.17] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id 21sm25123867pfp.211.2021.07.20.15.05.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jul 2021 15:05:06 -0700 (PDT) Subject: Re: [PATCH] gcov: Fix use of profile info section To: Sebastian Huber , gcc-patches@gcc.gnu.org References: <20210714074630.119391-1-sebastian.huber@embedded-brains.de> From: Jeff Law Message-ID: Date: Tue, 20 Jul 2021 16:05:05 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210714074630.119391-1-sebastian.huber@embedded-brains.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: 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-List-Received-Date: Tue, 20 Jul 2021 22:05:09 -0000 On 7/14/2021 1:46 AM, Sebastian Huber wrote: > If the -fprofile-info-section is used, then the gcov information is registered > in a linker set. This is done by build_gcov_info_var_registration(). The > compiler generated object placed in the section was not marked as referenced, > so once optimization was enabled, this object was optimized away. Mark it as > referenced. > > gcc/ > coverage.c (build_gcov_info_var_registration): Mark the object placed > in the linker set as referenced so that it does not get optimized away. OK jeff