All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Fangrui Song <maskray@google.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	linux-toolchains@vger.kernel.org
Subject: Re: [PATCH] Kbuild: implement support for DWARF5
Date: Tue, 3 Nov 2020 14:27:05 -0800	[thread overview]
Message-ID: <CAKwvOdmLN5BWAh35z2LyHvQ_P4pgyCaFohOphpgXUmMAehnV_g@mail.gmail.com> (raw)
In-Reply-To: <20201022014448.mcx5n7unf7kkka3o@google.com>

On Wed, Oct 21, 2020 at 6:44 PM Fangrui Song <maskray@google.com> wrote:
>
> On 2020-10-21, 'Nick Desaulniers' via Clang Built Linux wrote:
> >DWARF5 is the latest standard of the DWARF debug info format.
> >
> >Feature detection of DWARF5 is onerous, especially given that we've
> >removed $(AS), so we must query $(CC) for DWARF5 assembler directive
> >support. Further -gdwarf-X where X is an unsupported value doesn't
> >produce an error in $(CC). GNU `as` only recently gained support for
> >specifying -gdwarf-5.
> >
> >The DWARF version of a binary can be validated with:
>
> To be more correct: this is just the version number of the .debug_info section.
> Other sections can use different version numbers.
> (For example, GNU as still does not support version 5 .debug_line)

How do you recommend we validate that then?

>
> >$ llvm-dwarfdump vmlinux | head -n 5 | grep version
> >or
> >$ readelf --debug-dump=info vmlinux 2>/dev/null | grep Version
> >diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> >index cd14444bf600..0382808ef9fe 100644
> >--- a/include/asm-generic/vmlinux.lds.h
> >+++ b/include/asm-generic/vmlinux.lds.h
> >@@ -828,7 +828,11 @@
> >               .debug_types    0 : { *(.debug_types) }                 \
> >               /* DWARF 5 */                                           \
> >               .debug_macro    0 : { *(.debug_macro) }                 \
> >-              .debug_addr     0 : { *(.debug_addr) }
> >+              .debug_addr     0 : { *(.debug_addr) }                  \
> >+              .debug_line_str 0 : { *(.debug_line_str) }              \
> >+              .debug_loclists 0 : { *(.debug_loclists) }              \
> >+              .debug_rnglists 0 : { *(.debug_rnglists) }              \
> >+              .debug_str_offsets 0 : { *(.debug_str_offsets) }
>
> Consider adding .debug_names for the accelerator table.
> It is the DWARF v5 version of .debug_pub{names,types} (which are mentioned
> a few lines above).

I hadn't seen that section produced in my limited testing.  Being a
fan of TDD, I kind of would like to see the linker warn on orphan
section placement, then add it to the list, as I did with the above.
Do you have more info on when or how .debug_pub* can be produced?

Thanks for the rest of the feedback, I'll incorporate it into v2.

-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2020-11-03 22:27 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  1:21 [PATCH] Kbuild: implement support for DWARF5 Nick Desaulniers
2020-10-22  1:44 ` Fangrui Song
2020-11-03 22:27   ` Nick Desaulniers [this message]
2020-10-28 18:18 ` Nick Desaulniers
2020-11-02  2:20 ` Masahiro Yamada
2020-11-02  8:18   ` Jakub Jelinek
2020-11-03 22:21     ` Nick Desaulniers
2020-11-04 12:19       ` Jakub Jelinek
2020-11-03 22:13   ` Nick Desaulniers
2020-11-04  0:53   ` [PATCH v2 0/4] Kbuild: DWARF v5 support Nick Desaulniers
2020-11-04  0:53     ` [PATCH v2 1/4] x86_64: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S Nick Desaulniers
2020-11-04  0:53     ` [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Nick Desaulniers
2020-11-05  6:58       ` Nathan Chancellor
2020-11-05  7:26         ` Fangrui Song
2020-11-09 18:28         ` Nick Desaulniers
2020-11-09 18:35           ` [PATCH v3] " Nick Desaulniers
2020-11-16 23:41             ` Nick Desaulniers
     [not found]               ` <CA+SOCLJTg6U+Ddop_5O-baVR42va3vGAvMQ62o9H6rd+10aKrw@mail.gmail.com>
2020-11-23 18:42                 ` Nick Desaulniers
2020-11-24 18:44                   ` Masahiro Yamada
2020-11-04  0:53     ` [PATCH v2 3/4] Kbuild: make DWARF version a choice Nick Desaulniers
2020-11-05  5:58       ` kernel test robot
2020-11-05  5:58         ` kernel test robot
2020-11-23 23:22       ` Arvind Sankar
2020-11-24  0:33         ` Segher Boessenkool
2020-11-24 16:56           ` Arvind Sankar
2020-11-24 17:46             ` Segher Boessenkool
2020-11-30 18:04       ` Masahiro Yamada
2020-11-30 20:27         ` Fāng-ruì Sòng
2020-12-01  3:38           ` Masahiro Yamada
2020-12-01  9:32             ` Segher Boessenkool
2020-12-02  1:08               ` Fāng-ruì Sòng
2020-11-30 20:45         ` Nick Desaulniers
2020-12-01  4:17           ` Masahiro Yamada
2020-11-04  0:53     ` [PATCH v2 4/4] Kbuild: implement support for DWARF v5 Nick Desaulniers
2020-11-24 17:28       ` Arvind Sankar
2020-12-03 23:22         ` Nick Desaulniers
2020-12-03 23:28           ` Nick Desaulniers
2020-12-04 17:06             ` Arvind Sankar
2020-12-10 23:18               ` Nick Desaulniers
2020-12-11  0:29                 ` Arvind Sankar
2020-12-01  1:56       ` Masahiro Yamada
2020-11-04  0:00 ` [PATCH] Kbuild: implement support for DWARF5 Arvind Sankar
2020-11-04  0:05   ` Nick Desaulniers
2020-11-04  0:17     ` Arvind Sankar
2020-12-03 22:56       ` Nick Desaulniers
2020-12-04  0:17         ` Nick Desaulniers

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=CAKwvOdmLN5BWAh35z2LyHvQ_P4pgyCaFohOphpgXUmMAehnV_g@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=maskray@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.