Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 11, 2025

@llvm/pr-subscribers-bolt

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/139437.diff

1 Files Affected:

  • (modified) bolt/lib/Rewrite/BuildIDRewriter.cpp (+1-2)
diff --git a/bolt/lib/Rewrite/BuildIDRewriter.cpp b/bolt/lib/Rewrite/BuildIDRewriter.cpp
index 83d0c9bfe182a..d50416fb80c6c 100644
--- a/bolt/lib/Rewrite/BuildIDRewriter.cpp
+++ b/bolt/lib/Rewrite/BuildIDRewriter.cpp
@@ -78,8 +78,7 @@ Error BuildIDRewriter::sectionInitializer() {
                                  "out of bounds while reading note section: %s",
                                  toString(Cursor.takeError()).c_str());
 
-      if (Type == ELF::NT_GNU_BUILD_ID && Name.substr(0, 3) == "GNU" &&
-          DescSz) {
+      if (Type == ELF::NT_GNU_BUILD_ID && Name.starts_with("GNU") && DescSz) {
         BuildIDSection = NoteSection;
         BuildID = Desc;
         BC.setFileBuildID(getPrintableBuildID(Desc));

@kazutakahirata kazutakahirata merged commit 074c420 into llvm:main May 11, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_StringRef_starts_with_bolt_gnu branch May 11, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants