From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107945 invoked by alias); 4 Mar 2020 09:01:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 107932 invoked by uid 89); 4 Mar 2020 09:01:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f193.google.com Received: from mail-lj1-f193.google.com (HELO mail-lj1-f193.google.com) (209.85.208.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Mar 2020 09:00:54 +0000 Received: by mail-lj1-f193.google.com with SMTP id q19so1096438ljp.9 for ; Wed, 04 Mar 2020 01:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lbxk3x6PBWvIBc0FZBkyrMpg4PkBVztUdVaolGXdgS4=; b=A1/ERS66SRKpglMiRqXFrqTstSBVN/i/ryAamTTRtHMnY1u6+d948XsxYIdJS4ZstI xeLfjwoJ1Z3a0lAelhlH/zfudvQvFo1HDpw3BBHR7g/7843dsSigalWz7kZ6z25NINup je8PZS4wkI6HpyUgD6Nyne3rbbR2jvYHdDOsTN7yrFfwYwR8j7Vvfjrx2MvLDkrfr7QR jyUbUIxSWn3gMy/wreDz6OrjzboN/eMJKqDDy8Rlp8uNj2mi2ZxGpzwE66tDFAR2TGc+ mm2YElgl8tmZ7+PHeQAJ0oyT7c82UFQotTUUaSq1hebZRXDlzZY6GhvUCXqv93lRdMxV bNVA== MIME-Version: 1.0 References: <1583246660-6390-1-git-send-email-egeyar.bagcioglu@oracle.com> <1583246660-6390-4-git-send-email-egeyar.bagcioglu@oracle.com> In-Reply-To: <1583246660-6390-4-git-send-email-egeyar.bagcioglu@oracle.com> From: Richard Biener Date: Wed, 04 Mar 2020 09:01:00 -0000 Message-ID: Subject: Re: [PATCH v2 3/3] Keep .GCC.command.line sections of LTO objetcs. To: Egeyar Bagcioglu Cc: GCC Patches , =?UTF-8?Q?Martin_Li=C5=A1ka?= , Segher Boessenkool Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00195.txt On Tue, Mar 3, 2020 at 5:41 PM Egeyar Bagcioglu wrote: > > This patch is for .GCC.command.line sections in LTO objects to be copied > into the final objects as in the following example: > > [egeyar@localhost lto]$ gcc -flto -O3 demo.c -c -g --record-gcc-command-line > [egeyar@localhost lto]$ gcc -flto -O2 demo2.c -c -g --record-gcc-command-line -DFORTIFY=2 > [egeyar@localhost lto]$ gcc demo.o demo2.o -o a.out > [egeyar@localhost lto]$ readelf -p .GCC.command.line a.out > > String dump of section '.GCC.command.line': > [ 0] 10.0.1 20200227 (experimental) : gcc -flto -O3 demo.c -c -g --record-gcc-command-line > [ 56] 10.0.1 20200227 (experimental) : gcc -flto -O2 demo2.c -c -g --record-gcc-command-line -DFORTIFY=2 --record-gcc-command-line is not a FSF GCC option, there's -frecord-gcc-switches though which (also) populates .GCC.command.line OK. Thanks, Richard. > Regards > Egeyar > > libiberty: > 2020-02-27 Egeyar Bagcioglu > > * simple-object.c (handle_lto_debug_sections): Name > ".GCC.command.line" among debug sections to be copied over > from lto objects. > --- > libiberty/simple-object.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libiberty/simple-object.c b/libiberty/simple-object.c > index d9c648a..3b3ca9c 100644 > --- a/libiberty/simple-object.c > +++ b/libiberty/simple-object.c > @@ -298,6 +298,9 @@ handle_lto_debug_sections (const char *name, int rename) > COMDAT sections in objects produced by GCC. */ > else if (strcmp (name, ".comment") == 0) > return strcpy (newname, name); > + /* Copy over .GCC.command.line section under the same name if present. */ > + else if (strcmp (name, ".GCC.command.line") == 0) > + return strcpy (newname, name); > free (newname); > return NULL; > } > -- > 1.8.3.1 >