[PATCH] D61197: [LLD][ELF] Fix getRankProximity to "ignore" not live sections

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 01:47:53 PDT 2019


grimar added a comment.

@MaskRay is right that the linker script can be simplified to `SECTIONS { .pad : { QUAD(0); } .text : { *(.text) } .ro : { *(.ro) } }`, I think it looks much simpler.

It is strange for me to see `!Live` output section that is actually in the output though. Let me debug it a bit.



================
Comment at: ELF/Writer.cpp:1054
+  auto *Sec = dyn_cast<OutputSection>(B);
+  return (Sec && Sec->Live) ? getRankProximityAux(A, Sec) : -1;
 }
----------------
MaskRay wrote:
> Delete the parentheses?
> 
> `COFF/PDB.cpp` contains `C && OS ? C->getRVA() - OS->getRVA() : 0` and there is no parentheses.
I would keep them for readability.


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

https://reviews.llvm.org/D61197





More information about the llvm-commits mailing list