[PATCH] D59553: [LLD][ELF][DebugInfo] llvm-symbolizer shows incorrect source line info if --gc-sections used
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 9 20:08:10 PDT 2019
MaskRay resigned from this revision.
MaskRay added a comment.
In D59553#1460304 <https://reviews.llvm.org/D59553#1460304>, @avl wrote:
> > __libc_csu_init is in libc.a(elf-init.o) and has no debug info. It should symbolize to ?? but not_used.cpp is incorrectly returned. ?? -> not_used.cpp
>
> I did not see that problem if this fix applied. Everything looks exactly like you expect:
>
> nm res.out
> 0000000000201100 T __libc_csu_init
>
> U __libc_start_main
>
> 00000000002010f0 T main
>
> llvm-symbolizer -obj=res.o 0x0000000000201100
> __libc_csu_init
> ??:0:0 <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> llvm-symbolizer -obj=res.o 0x00000000002010f0
> main
> main.cpp:2:4 <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Did I correctly understand the problem which you are talking about?
>
> > A more serious problem is when a main.cpp symbol incorrectly resolves to not_used.cpp. I created D60470 <https://reviews.llvm.org/D60470> to fix that.
>
> Would solution from D60470 <https://reviews.llvm.org/D60470> work correctly for platform where 0 is a valid virtual address ?
See my comment at https://reviews.llvm.org/D60470#1460670.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59553/new/
https://reviews.llvm.org/D59553
More information about the llvm-commits
mailing list