[llvm] [llvm-objcopy][ELF] Disable huge section offset (PR #97036)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 04:25:30 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 b11a70392c6ef3c481421f9f0a6651030333ebdc df0c7f2b553d47148e714e1ef0197712c785f7a3 --extensions cpp,h -- llvm/include/llvm/ObjCopy/ELF/ELFConfig.h llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp llvm/lib/ObjCopy/ELF/ELFObject.cpp llvm/lib/ObjCopy/ELF/ELFObject.h llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/ObjCopy/ELF/ELFObject.cpp b/llvm/lib/ObjCopy/ELF/ELFObject.cpp
index 32276dc4a1..6987c18b96 100644
--- a/llvm/lib/ObjCopy/ELF/ELFObject.cpp
+++ b/llvm/lib/ObjCopy/ELF/ELFObject.cpp
@@ -2746,12 +2746,12 @@ Error BinaryWriter::finalize() {
       TotalSize = std::max(TotalSize, Sec.Offset + Sec.Size);
 
       if (MaxSectionOffset && Sec.Offset > *MaxSectionOffset) {
-        return createStringError(errc::file_too_large,
-                                 "writing section " + Sec.Name + " at offset 0x" +
-                                     Twine::utohexstr(Sec.Offset) +
-                                     " greater than max offset 0x" +
-                                     Twine::utohexstr(*MaxSectionOffset) +
-                                     " specified by --set-max-section-offset");
+        return createStringError(
+            errc::file_too_large,
+            "writing section " + Sec.Name + " at offset 0x" +
+                Twine::utohexstr(Sec.Offset) + " greater than max offset 0x" +
+                Twine::utohexstr(*MaxSectionOffset) +
+                " specified by --set-max-section-offset");
       }
     }
 

``````````

</details>


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


More information about the llvm-commits mailing list