* [PATCH] dwarf_loader: Sync with LINUX_ELFNOTE_LTO_INFO macro from kernel
@ 2023-01-20 20:12 Sedat Dilek
2023-01-20 22:57 ` Yonghong Song
0 siblings, 1 reply; 2+ messages in thread
From: Sedat Dilek @ 2023-01-20 20:12 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
bpf, Nathan Chancellor, Nick Desaulniers, Tom Rix, llvm
Cc: Sedat Dilek, Yonghong Song
As long as I am using CONFIG_DEBUG_INFO_BTF=y with LLVM/Clang
I have noticed the below macros where defined unconsistently.
See here pahole latest Git...
[ pahole:dwarf_loader ]
/* Match the define in linux:include/linux/elfnote.h */
#define LINUX_ELFNOTE_BUILD_LTO 0x101
...and latest Linus v6.2-rc4+ Git:
[ linux:include/linux/elfnote-lto.h ]
#define LINUX_ELFNOTE_LTO_INFO 0x101
Yonghong Song says:
> Ya, LINUX_ELFNOTE_BUILD_LTO is initially proposed macro name but later
> the formal kernel patch used LINUX_ELFNOTE_LTO_INFO. Could you submit
> a pahole for this so it is consistent with kernel? Thanks!
Fix this by syncing the pahole macro with the one from linux-kernel.
Suggested-by: Yonghong Song <yhs@meta.com>
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
dwarf_loader.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dwarf_loader.c b/dwarf_loader.c
index 5a74035c5708..96ce5db4f5bc 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -2808,8 +2808,8 @@ static int __cus__load_debug_types(struct conf_load *conf, Dwfl_Module *mod, Dwa
return 0;
}
-/* Match the define in linux:include/linux/elfnote.h */
-#define LINUX_ELFNOTE_BUILD_LTO 0x101
+/* Match the define in linux:include/linux/elfnote-lto.h */
+#define LINUX_ELFNOTE_LTO_INFO 0x101
static bool cus__merging_cu(Dwarf *dw, Elf *elf)
{
@@ -2827,7 +2827,7 @@ static bool cus__merging_cu(Dwarf *dw, Elf *elf)
size_t name_off, desc_off, offset = 0;
GElf_Nhdr hdr;
while ((offset = gelf_getnote(data, offset, &hdr, &name_off, &desc_off)) != 0) {
- if (hdr.n_type != LINUX_ELFNOTE_BUILD_LTO)
+ if (hdr.n_type != LINUX_ELFNOTE_LTO_INFO)
continue;
/* owner is Linux */
--
2.39.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dwarf_loader: Sync with LINUX_ELFNOTE_LTO_INFO macro from kernel
2023-01-20 20:12 [PATCH] dwarf_loader: Sync with LINUX_ELFNOTE_LTO_INFO macro from kernel Sedat Dilek
@ 2023-01-20 22:57 ` Yonghong Song
0 siblings, 0 replies; 2+ messages in thread
From: Yonghong Song @ 2023-01-20 22:57 UTC (permalink / raw)
To: Sedat Dilek, Arnaldo Carvalho de Melo, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, bpf, Nathan Chancellor, Nick Desaulniers,
Tom Rix, llvm
On 1/20/23 12:12 PM, Sedat Dilek wrote:
> As long as I am using CONFIG_DEBUG_INFO_BTF=y with LLVM/Clang
> I have noticed the below macros where defined unconsistently.
>
> See here pahole latest Git...
>
> [ pahole:dwarf_loader ]
>
> /* Match the define in linux:include/linux/elfnote.h */
> #define LINUX_ELFNOTE_BUILD_LTO 0x101
>
> ...and latest Linus v6.2-rc4+ Git:
>
> [ linux:include/linux/elfnote-lto.h ]
>
> #define LINUX_ELFNOTE_LTO_INFO 0x101
>
> Yonghong Song says:
>> Ya, LINUX_ELFNOTE_BUILD_LTO is initially proposed macro name but later
>> the formal kernel patch used LINUX_ELFNOTE_LTO_INFO. Could you submit
>> a pahole for this so it is consistent with kernel? Thanks!
>
> Fix this by syncing the pahole macro with the one from linux-kernel.
>
> Suggested-by: Yonghong Song <yhs@meta.com>
> Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Thanks!
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-20 22:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-20 20:12 [PATCH] dwarf_loader: Sync with LINUX_ELFNOTE_LTO_INFO macro from kernel Sedat Dilek
2023-01-20 22:57 ` Yonghong Song
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.