[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
Wed Mar 20 11:58:20 PDT 2019


avl marked 3 inline comments as done.
avl added inline comments.


================
Comment at: lld/ELF/InputSection.cpp:785
 void InputSection::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
+  assert(!Config->Relocatable);
+
----------------
ruiu wrote:
> 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?
> 
That UINT64_MAX thing should be done for only !Config->Relocatable case. 
So I added this assertion to be sure that routine could not be called for other cases.
If it does not fit with the design - would it be better to move that assertion closer to  
Target->relocateOne(BufLoc, Type, SignExtend64<Bits>(UINT64_MAX - 1)); ?


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list