diff options
| author | Alyssa Ross <[email protected]> | 2023-12-19 11:03:24 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-12-21 09:05:15 +0000 |
| commit | 812d8bf87678f77055b575d20636fdbbbf15edaf (patch) | |
| tree | a5f0ff77c9bc6860c18f6a746118d98655ca4661 /tools/lib/bpf/linker.c | |
| parent | Merge branch 'bpf-fix-warning-in-check_obj_size' (diff) | |
| download | kernel-812d8bf87678f77055b575d20636fdbbbf15edaf.tar.gz kernel-812d8bf87678f77055b575d20636fdbbbf15edaf.zip | |
libbpf: Skip DWARF sections in linker sanity check
clang can generate (with -g -Wa,--compress-debug-sections) 4-byte
aligned DWARF sections that declare themselves to be 8-byte aligned in
the section header. Since DWARF sections are dropped during linking
anyway, just skip running the sanity checks on them.
Reported-by: Sergei Trofimovich <[email protected]>
Suggested-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alyssa Ross <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Closes: https://lore.kernel.org/bpf/[email protected]/
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/linker.c')
| -rw-r--r-- | tools/lib/bpf/linker.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index 52a2901e8bd0..16bca56002ab 100644 --- a/tools/lib/bpf/linker.c +++ b/tools/lib/bpf/linker.c @@ -719,6 +719,9 @@ static int linker_sanity_check_elf(struct src_obj *obj) return -EINVAL; } + if (is_dwarf_sec_name(sec->sec_name)) + continue; + if (sec->shdr->sh_addralign && !is_pow_of_2(sec->shdr->sh_addralign)) { pr_warn("ELF section #%zu alignment %llu is non pow-of-2 alignment in %s\n", sec->sec_idx, (long long unsigned)sec->shdr->sh_addralign, |
