[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:26:10 PDT 2019


grimar added inline comments.


================
Comment at: lld/ELF/InputSection.cpp:813
+    uint64_t OutOfModuleOffset = 0;
+    if (!Config->Relocatable && !Sym.getOutputSection() && Name.startswith(".debug_"))
+      OutOfModuleOffset = Out::ModuleHighPC;
----------------
jhenderson wrote:
> grimar wrote:
> > 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.
> > 
> Be careful with references to weak undefined symbols. We don't want to patch those to an invalid address by accident, so this should only affect patching of .debug* sections, I think.
This function is called for non-alloc sections only (i.e. debug ones). So, we should be fine I think.


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list