[PATCH] D68065: Propeller: LLD Support for Basic Block Sections

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 11:56:36 PST 2020


tmsriram marked an inline comment as done.
tmsriram added inline comments.


================
Comment at: lld/ELF/InputSection.h:134
+  // instruction. The members below help trimming the trailing jump instruction
+  // and shrinking a section.
+  unsigned bytesDropped = 0;
----------------
tmsriram wrote:
> ruiu wrote:
> > Now I wonder if you can just shrink `rawData`? Then you can revert he change you made to `getSize()`.
> I looked at this and saw that "trimmed" can be deleted which simplifies the code here and in getSize() much more.  
> 
> I need to keep track of actual available space and shrunk space.  This is because we both shrink and grow the section, a follow-up patch that does this optimization.  So, bytesDropped is useful to undo the shrink.  PTAL and see if the simplification helps.
> 
> Also, if we dont keep track of the actual size of the section when growing and shrinking, it is not possible to catch bugs where we accidentally grow more than the original size of the section, potentially writing out-of-bounds into rawData.
Sorry, I mistyped the last line.  It should read "potentially reading out-of-bounds from rawData".  


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

https://reviews.llvm.org/D68065





More information about the llvm-commits mailing list