[PATCH] D59553: llvm-symbolizer shows incorrect source line info if --gc-sections used

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 03:11:15 PDT 2019


grimar added a comment.

I would recommend adding a "[LLD][ELF]...." prefix to the patch title. Now as was already mentioned it looks like a patch for symbolizer.

In D59553#1436073 <https://reviews.llvm.org/D59553#1436073>, @jhenderson wrote:

> Rather than picking an arbitrary value out of module scope, how about something more explicit, e.g. -1 (or -2)? It's very unlikely that this will ever be a valid address. Note that picking -1 has issues in .debug_ranges, due to it being a special value in that section, hence the -2 suggestion.


Yeah, I also wondered if just something like UINT_MAX would work. If we are able to use a constant, that would make the patch much simpler.

Rui, would you accept such an approach? (this patch has other issues, e.g. the test cases seems contain too much excessive things, I would help to clean it up if the approach is OK for you).



================
Comment at: lld/ELF/InputSection.cpp:813
+    uint64_t OutOfModuleOffset = 0;
+    if (!Config->Relocatable && !Sym.getOutputSection() && Name.startswith(".debug_"))
+      OutOfModuleOffset = Out::ModuleHighPC;
----------------
I do not think this method can be called when `Config->Relocatable` actually?
Also checking the symbol name is very hacky, I would remove it.



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59553/new/

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list