linux-stable/tools/lib
Andrii Nakryiko a111f8e113 libbpf: Accommodate DWARF/compiler bug with duplicated structs
[ Upstream commit efdd3eb801 ]

According to [0], compilers sometimes might produce duplicate DWARF
definitions for exactly the same struct/union within the same
compilation unit (CU). We've had similar issues with identical arrays
and handled them with a similar workaround in 6b6e6b1d09 ("libbpf:
Accomodate DWARF/compiler bug with duplicated identical arrays"). Do the
same for struct/union by ensuring that two structs/unions are exactly
the same, down to the integer values of field referenced type IDs.

Solving this more generically (allowing referenced types to be
equivalent, but using different type IDs, all within a single CU)
requires a huge complexity increase to handle many-to-many mappings
between canonidal and candidate type graphs. Before we invest in that,
let's see if this approach handles all the instances of this issue in
practice. Thankfully it's pretty rare, it seems.

  [0] https://lore.kernel.org/bpf/YXr2NFlJTAhHdZqq@krava/

Reported-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211117194114.347675-1-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:04:28 +01:00
..
api tools api fs: Cache cgroupfs mount point 2021-02-17 15:09:08 -03:00
bpf libbpf: Accommodate DWARF/compiler bug with duplicated structs 2022-01-27 11:04:28 +01:00
lockdep .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf libperf tests: Fix test_stat_cpu 2021-10-14 15:41:35 -03:00
subcmd libsubcmd: add OPT_UINTEGER_OPTARG option type 2021-08-31 15:44:05 -03:00
symbol libsymbols kallsyms: Move hex2u64 out of header 2020-05-05 16:35:32 -03:00
traceevent KVM: x86/mmu: Rename "nxe" role bit to "efer_nx" for macro shenanigans 2021-06-24 18:00:41 -04:00
argv_split.c tools lib: Move argv_{split,free} from tools/perf/util/ 2019-07-01 22:50:40 -03:00
bitmap.c tools lib: Adopt bitmap_intersects() operation from the kernel sources 2021-06-30 15:28:00 -03:00
ctype.c tools perf: Move from sane_ctype.h obtained from git to the Linux's original 2019-06-25 21:02:47 -03:00
find_bit.c tools: sync lib/find_bit implementation 2021-05-06 19:24:12 -07:00
hweight.c
rbtree.c tools/: replace HTTP links with HTTPS ones 2020-08-07 11:33:21 -07:00
str_error_r.c
string.c tools lib: Adopt memchr_inv() from kernel 2020-11-27 08:34:52 -03:00
vsprintf.c perf script: Pad DSO name for --call-trace 2019-05-28 18:37:44 -03:00
zalloc.c tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00