dwarf_loader: Sync with LINUX_ELFNOTE_LTO_INFO macro from kernel
PATCH 1/1 dwarf_loader: Sync with LINUX_ELFNOTE_LTO_INFO macro from kernel
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:
Quoted 3 lines
Ya,
LINUX_ELFNOTE_BUILD_LTOis initially proposed macro name but later the formal kernel patch usedLINUX_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.
--- dwarf_loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
dwarf_loader.c +3 -3
@@ -2808,8 +2808,8 @@ static int __cus__load_debug_types(struct conf_load *conf, Dwfl_Module *mod, Dwareturn 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 0x101static 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 */
Signature · 1 line
2.39.0
Quoted 17 lines · Sedat Dilek
As long as I am using
CONFIG_DEBUG_INFO_BTF=ywith 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 */
#defineLINUX_ELFNOTE_BUILD_LTO0x101...and latest Linus v6.2-rc4+ Git:
[ linux:include/linux/elfnote-lto.h ]
#define
LINUX_ELFNOTE_LTO_INFO0x101Yonghong Song says:
Quoted 8 lines
Quoted 3 lines
Ya,
LINUX_ELFNOTE_BUILD_LTOis initially proposed macro name but later the formal kernel patch usedLINUX_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 <[email protected]>Signed-off-by Sedat Dilek <[email protected]>
Thanks!