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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 10:57:12 PDT 2019


ruiu added a comment.

Is this logically correct? I wonder what is the point of emitting a relocation section pointing to a nonexistent section.



================
Comment at: lld/ELF/InputSection.cpp:785
 void InputSection::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
+  assert(!Config->Relocatable);
+
----------------
What does this assert mean? If you pass `-r` option to the linker, this function is not indeed called, but that's also true to many other options. Why is this option special?



================
Comment at: lld/ELF/InputSection.cpp:837
+    else
+      // if relocation points to the deleted section(-Wl,--gc-sections)
+      // then - it is neccessary to make start offset to be out of
----------------
if -> If

Add a space before an open parenthesis.


================
Comment at: lld/ELF/InputSection.cpp:839
+      // then - it is neccessary to make start offset to be out of
+      // module address range to not to overlap with module`s ranges.
+      // UINT64_MAX-1 used as maximal value of an address. UINT64_MAX has
----------------
` -> '


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list