[PATCH] D127581: [ELF] Relax R_RISCV_ALIGN

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 13:27:35 PDT 2022


gkm added inline comments.


================
Comment at: lld/ELF/Arch/RISCV.cpp:593
+      // Tell assignAddresses that the size has changed.
+      sec->bytesDropped = delta;
+    }
----------------
`InputSectionBase::bytesDropped` is merely `uint8_t`, and feels vulnerable to overflow. The comment on the decl says it is intended for basic-block sections, for which 8 bits is reasonable, but this new use, it might be inadequate. Perhaps `uint16_t` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127581



More information about the llvm-commits mailing list