[clang] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 10:05:29 PDT 2023


b-sumner wrote:

Actually the DWARF and ELF are inconsistent now and this patch removes that inconsistency.  For example, for a global int named "gv" the DWARF says

< 1><0x00000023>    DW_TAG_variable
                      DW_AT_name                  (indexed string: 0x00000003)**gv**
                      DW_AT_type                  <0x0000002e>
                      DW_AT_external              yes(1)
                      DW_AT_decl_file             0x00000000 /tmp/t.c
                      DW_AT_decl_line             0x00000002
                      DW_AT_location              len 0x0002: 0xa100:
                          DW_OP_addrx 0
< 1><0x0000002e>    DW_TAG_base_type
                      DW_AT_name                  (indexed string: 0x00000004)int
                      DW_AT_encoding              DW_ATE_signed
                      DW_AT_byte_size             **0x00000004**

while the ELF says:

Symbol table '.symtab' contains 5731 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
…
  5729: 0000000000ca15e0    **32** OBJECT  GLOBAL DEFAULT   28 **gv**


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


More information about the cfe-commits mailing list