[llvm] [RFC] Emit dwarf data for signature-changed or new functions (PR #157349)
Vladislav Dzhidzhoev via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 2 05:05:19 PDT 2025
dzhidzhoev wrote:
> So in my opinion, having two DW_TAG_subprogram's at the same level with identical func name probably will break some tools. WDYT?
I don't think this is a problem, especially when functions have different signatures. For example, DWARF in [0] has the same DW_AT_names, and I think the majority of tools will easily process it.
> From pahole perspective, it founds two functions which has identical name 'bpf_lsm_socket_getpeersec_stream' with different number of parameters. Note that in the above, there are two DW_TAG_subprogram with the same name and at the same level.
Are you sure that the tool matches functions based on the name in DWARF? I'm not familiar with pahole, but briefly looking at this, I assume that the error is caused by having two ELF symbols (functions) having the same name but different signature ([1] [2] some functions are matched based on `elf->name` field). Correct me if I'm wrong.
[0] https://godbolt.org/z/9cW6xsr4z
[1] https://github.com/acmel/dwarves/blob/042d73962d35fdd1466e056f1ea14590b1cdbb9b/btf_encoder.c#L1463
[2] https://github.com/acmel/dwarves/blob/042d73962d35fdd1466e056f1ea14590b1cdbb9b/btf_encoder.c#L1371
https://github.com/llvm/llvm-project/pull/157349
More information about the llvm-commits
mailing list