[PATCH] D139092: [RFC][LLD][ELF] Cortex-M Security Extensions (CMSE) Support

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 11:16:12 PST 2023


MaskRay added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1675
+    case OPT_in_implib:
+      if (std::optional<MemoryBufferRef> mb = readFile(arg->getValue()))
+        files.push_back(createObjFile(*mb));
----------------
amilendra wrote:
> MaskRay wrote:
> > This parses the `--in-implib=` file as a regular file and requires a condition in the generic parsing code which I have mentioned is improper.
> > 
> > If the parse order does not matter, record this in a vector and perform parsing in the end of `llvm::TimeTraceScope timeScope("Parse input files");`
> Thanks for the reviews.
> I think the suggestion is to create a new subclass of `ELFFileBase`. Is my understanding correct?
> And yes I don't think the parse order matters, so can do it after parsing the rest of the input files.
No. I don't think a new subclass is needed. We just need a function (maybe a `ObjFile` member function; I don't think too much) for `--in-implib` doing things similar to `if (this->justSymbols)` in `ObjFile<ELFT>::parse`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139092



More information about the llvm-commits mailing list