On Wed, Mar 31, 2021 at 7:58 PM Yonghong Song <yhs@xxxxxx> wrote: > > Function cus__merging_cu() is introduced in Commit 39227909db3c > ("dwarf_loader: Permit merging all DWARF CU's for clang LTO built > binary") to test whether cross-cu references may happen. > The original implementation anticipates compilation flags > in dwarf, but later some concerns about binary size surfaced > and the decision is to scan .debug_abbrev as a faster way > to check cross-cu references. Also putting a note in vmlinux > to indicate whether lto is enabled for built or not can > provide a much faster way. > > This patch set implemented this two approaches, first > checking the note (in Patch #2), if not found, then > check .debug_abbrev (in Patch #1). For the series: Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Tested-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> (Noting for others on our mailing list: https://lore.kernel.org/linux-kbuild/20210401012406.1800957-1-yhs@xxxxxx/ is a series of kernel patches required to test this. I had feedback on the kernel patches, but this approach in pahole LGTM since I think using simple notes in ELF is a good approach). > > Yonghong Song (2): > dwarf_loader: check .debug_abbrev for cross-cu references > dwarf_loader: check .notes section for lto build info > > dwarf_loader.c | 76 ++++++++++++++++++++++++++++++++++++-------------- > 1 file changed, 55 insertions(+), 21 deletions(-) > > -- > 2.30.2 > -- Thanks, ~Nick Desaulniers