[llvm] [RFC] Emit dwarf data for signature-changed or new functions (PR #157349)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 22 18:17:17 PDT 2025


yonghong-song wrote:

@dzhidzhoev I tried to replace something like
```
0x000000ab:   DW_TAG_inlined_subroutine                                                                                                                    
                DW_AT_name      ("foo")                                                                                                                    
                DW_AT_type      (0x0000008a "char *")                                                                                                      
                DW_AT_artificial        (true)                                                                                                             
                DW_AT_specification     (0x0000004b "foo")                                                                                                 
                                                                                                                                                           
0x000000b5:     DW_TAG_formal_parameter                                                                                                                    
                  DW_AT_name    ("")                                                                                                                       
                  DW_AT_type    (0x00000093 "t *")                                                                                                         
                                                                                                                                                           
0x000000bb:     NULL 
```
to
```
0x000000ab:   DW_TAG_subprogram
                DW_AT_name      ("foo")
                DW_AT_type      (0x0000008a "char *")
                DW_AT_artificial        (true)
                DW_AT_trampoline        (0x0000004b)

0x000000b5:     DW_TAG_formal_parameter
                  DW_AT_name    ("")
                  DW_AT_type    (0x00000093 "t *")

0x000000bb:     NULL
```

and linux kernel build failed
```
  LD      vmlinux
  BTFIDS  vmlinux
WARN: resolve_btfids: unresolved symbol bpf_lsm_socket_getpeersec_stream
make[2]: *** [/home/yhs/work/bpf-next/scripts/Makefile.vmlinux:91: vmlinux] Error 255
make[2]: *** Deleting file 'vmlinux'
make[1]: *** [/home/yhs/work/bpf-next/Makefile:1244: vmlinux] Error 2
make: *** [/home/yhs/work/bpf-next/Makefile:248: __sub-make] Error 2
[~/work/linux-bld]$
```

I think this is due to `pahole` tool which processes dwarf and generate BTF.
So I think we probably should stick to DW_TAG_inlined_subroutine to avoid regression for dwarf-processing tools.

https://github.com/llvm/llvm-project/pull/157349


More information about the llvm-commits mailing list