Skip to content

[BOLT] Fix setHasSymbolsWithFileName #92625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2024
Merged

[BOLT] Fix setHasSymbolsWithFileName #92625

merged 2 commits into from
May 22, 2024

Conversation

aaupov
Copy link
Contributor

@aaupov aaupov commented May 18, 2024

The function is used to ignore the parameter and set
HasSymbolsWithFileName unconditionally.

The function is used to ignore the parameter and set
`HasSymbolsWithFileName` unconditionally.
@llvmbot
Copy link
Member

llvmbot commented May 18, 2024

@llvm/pr-subscribers-bolt

Author: Amir Ayupov (aaupov)

Changes

The function is used to ignore the parameter and set
HasSymbolsWithFileName unconditionally.


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

1 Files Affected:

  • (modified) bolt/include/bolt/Core/BinaryContext.h (+1-1)
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index 75765819ac464..792c09dd7c467 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -359,7 +359,7 @@ class BinaryContext {
   void setFileBuildID(StringRef ID) { FileBuildID = std::string(ID); }
 
   bool hasSymbolsWithFileName() const { return HasSymbolsWithFileName; }
-  void setHasSymbolsWithFileName(bool Value) { HasSymbolsWithFileName = true; }
+  void setHasSymbolsWithFileName(bool Value) { HasSymbolsWithFileName = Value; }
 
   /// Return true if relocations against symbol with a given name
   /// must be created.

Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this function at all? Can something be ever set to false?

@aaupov
Copy link
Contributor Author

aaupov commented May 22, 2024

Yes, if the input file has file symbols stripped, we will incorrectly set it to true.

Copy link
Contributor

@rafaelauler rafaelauler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aaupov aaupov merged commit a79acb0 into llvm:main May 22, 2024
4 checks passed
@aaupov aaupov deleted the no-file-sym2 branch May 22, 2024 20:57
aaupov added a commit to aaupov/llvm-project that referenced this pull request May 23, 2024
This reverts commit ccabbff.

Reintroduce allow-stripped as a fallback mechanism after enforcement of
HasSymbolsWithFileName was fixed in
llvm#92625.
aaupov added a commit that referenced this pull request May 23, 2024
…ching the profile (#93238)

Reintroduce allow-stripped as a fallback mechanism after enforcement of
HasSymbolsWithFileName was fixed in
#92625.

This partially reverts commit ccabbff.
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.

4 participants