public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/113566] btf: incorrect BTF_KIND_DATASEC entries for variables which are optimized out
Date: Tue, 09 Apr 2024 15:47:39 +0000	[thread overview]
Message-ID: <bug-113566-4-jHYKcRpiFG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113566-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113566

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Faust <dfaust@gcc.gnu.org>:

https://gcc.gnu.org/g:8075477f81ae8d0abf64b80dfbd179151f91b417

commit r14-9876-g8075477f81ae8d0abf64b80dfbd179151f91b417
Author: David Faust <david.faust@oracle.com>
Date:   Mon Apr 8 11:10:41 2024 -0700

    btf: emit symbol refs in DATASEC entries only for BPF [PR114608]

    The behavior introduced in
      fa60ac54964 btf: Emit labels in DATASEC bts_offset entries.

    is only fully correct when compiling for the BPF target with BPF CO-RE
    enabled.  In other cases, depending on optimizations, it can result in
    an incorrect symbol reference in the entry bts_offset field for a symbol
    which may not be emitted at all, causing link-time undefined symbol
    reference errors like in PR114608.

    The offending bts_offset field of BTF_KIND_DATASEC entries is in reality
    only currently useful to consumers of BTF information for BPF programs
    anyway.  Correct the regression by only emitting symbol references in
    these entries when compiling for the BPF target.  For other targets, the
    behavior returns to that prior to fa60ac54964.

    The underlying cause is related to PR 113566 "btf: incorrect
    BTF_KIND_DATASEC entries for variables which are optimized out." A
    complete fix for 113566 is more involved and unsuitable for stage 4,
    but will be addressed in the near future.

    gcc/
            PR debug/114608
            * btfout.cc (btf_asm_datasec_entry): Only emit a symbol reference
when
            generating BTF for BPF CO-RE target.

    gcc/testsuite/
            PR debug/114608
            * gcc.dg/debug/btf/btf-datasec-1.c: Check bts_offset symbol
references
            only for BPF target.
            * gcc.dg/debug/btf/btf-datasec-2.c: Likewise.
            * gcc.dg/debug/btf/btf-pr106773.c: Likewise.

      reply	other threads:[~2024-04-09 15:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 19:47 [Bug debug/113566] New: " david.faust at oracle dot com
2024-04-09 15:47 ` cvs-commit at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113566-4-jHYKcRpiFG@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).