[lld] lld: add support for NOCROSSREFS(_TO) (PR #95714)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 16 14:59:53 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 253c28fa829cee0104c2fc59ed1a958980b5138c d7baadb71a0590e1950cd4eb744103ece8690eb3 -- lld/ELF/LinkerScript.h lld/ELF/Relocations.cpp lld/ELF/Relocations.h lld/ELF/ScriptParser.cpp lld/ELF/Writer.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 400013adf5..008b8f7efb 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2381,8 +2381,8 @@ void elf::checkNoCrossRefs() {
   // small.
   //
   // Idea is to traverse all relocations in all sections and report if
-  // prohibited reference was found. Note that NOCROSSREFS works with output section
-  // names.
+  // prohibited reference was found. Note that NOCROSSREFS works with output
+  // section names.
   for (ELFFileBase *file : ctx.objectFiles) {
     auto sections = file->getSections();
     std::string message = "";
@@ -2391,7 +2391,8 @@ void elf::checkNoCrossRefs() {
       if (sections[i]) {
         StringRef sectionName = sections[i]->name;
 
-        if (const auto *outSec = dyn_cast_or_null<OutputSection>(sections[i]->parent)) {
+        if (const auto *outSec =
+                dyn_cast_or_null<OutputSection>(sections[i]->parent)) {
           for (const auto &refs : script->nocrossrefs) {
             if (isNoCrefFromSection(refs, outSec)) {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/95714


More information about the llvm-commits mailing list