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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 11 17:22:22 PST 2023


MaskRay added inline comments.


================
Comment at: lld/ELF/SyntheticSections.cpp:2231
+  ArmCmseSGVeneer *ss = nullptr;
+  auto SI = symtab.cmseImportLib.find(sym->getName());
+  if (SI == symtab.cmseImportLib.end()) {
----------------



================
Comment at: lld/ELF/SyntheticSections.cpp:2273
+void ArmCmseSGSection::finalizeContents() {
+  auto it = std::partition(
+      this->sgSections.begin(), this->sgSections.end(), [](ArmCmseSGVeneer *i) {
----------------
stable_partition

Otherwise the behavior may be different with different C++ stdlib.


================
Comment at: lld/test/ELF/arm-cmse-implib.s:9
+// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o %t2 --out-implib=%t2.lib --in-implib=%t1.lib --cmse-implib %t2.o
+// RUN: llvm-readelf -s %t2 %t2.lib | FileCheck %s --check-prefix=CHECK2
+// RUN: llvm-objdump -d %t2 | FileCheck %s --check-prefix=DISS2
----------------
In addition, if you specify `-Map=%t.map`, lld will crash.


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