[PATCH] D59553: [LLD][ELF][DebugInfo] llvm-symbolizer shows incorrect source line info if --gc-sections used
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 21 02:09:20 PDT 2019
avl added a comment.
> Does this do the right thing for a 32-bit target? 64-bit is common, but not universal.
yes, it does.
$ clang++ -gdwarf-5 -O main.cpp -c -m32
$ clang++ -gdwarf-5 -O not_used.cpp -c -m32
$ clang++ -gdwarf-5 -O not_used.o main.o -Wl,--gc-sections -o res.out -m32 -fuse-ld=lld
$ llvm-symbolizer -obj=res.out 0x401110
main
/home/avl/bugs/gc_debuginfo/main.cpp:2:4
$ llvm-symbolizer -obj=res.out 0xfffffffe
_fini
/home/avl/bugs/gc_debuginfo/not_used.cpp:2:5
DW_TAG_compile_unit
DW_AT_producer ("clang version 9.0.0")
DW_AT_language (DW_LANG_C_plus_plus)
DW_AT_name ("main.cpp")
DW_AT_str_offsets_base (0x00000024)
DW_AT_stmt_list (0x00000071)
DW_AT_comp_dir ("/home/avl/bugs/gc_debuginfo")
DW_AT_addr_base (0x00000014)
DW_AT_low_pc (0x0000000000401110)
DW_AT_high_pc (0x0000000000401113)
DW_TAG_compile_unit
DW_AT_producer ("clang version 9.0.0")
DW_AT_language (DW_LANG_C_plus_plus)
DW_AT_name ("not_used.cpp")
DW_AT_str_offsets_base (0x00000008)
DW_AT_stmt_list (0x00000000)
DW_AT_comp_dir ("/home/avl/bugs/gc_debuginfo")
DW_AT_addr_base (0x00000008)
DW_AT_low_pc (0x00000000fffffffe)
DW_AT_high_pc (0x0000000100325a9f)
I would add 32-bit test case .
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59553/new/
https://reviews.llvm.org/D59553
More information about the llvm-commits
mailing list