-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[LLD][COFF] Implement ECExportThunkChunk::classof #130106
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes dyn_cast_or_null usage in maybeAddAddressTakenFunction (llvm#128440).
@llvm/pr-subscribers-platform-windows @llvm/pr-subscribers-lld-coff Author: Jacek Caban (cjacek) ChangesFixes Full diff: https://github.com/llvm/llvm-project/pull/130106.diff 2 Files Affected:
diff --git a/lld/COFF/Chunks.h b/lld/COFF/Chunks.h
index 06e9aae0e6f6e..9f68d5a325cc5 100644
--- a/lld/COFF/Chunks.h
+++ b/lld/COFF/Chunks.h
@@ -59,7 +59,8 @@ class Chunk {
SectionKind,
SectionECKind,
OtherKind,
- ImportThunkKind
+ ImportThunkKind,
+ ECExportThunkKind
};
Kind kind() const { return chunkKind; }
@@ -827,7 +828,10 @@ static const uint8_t ECExportThunkCode[] = {
class ECExportThunkChunk : public NonSectionCodeChunk {
public:
- explicit ECExportThunkChunk(Defined *targetSym) : target(targetSym) {}
+ explicit ECExportThunkChunk(Defined *targetSym)
+ : NonSectionCodeChunk(ECExportThunkKind), target(targetSym) {}
+ static bool classof(const Chunk *c) { return c->kind() == ECExportThunkKind; }
+
size_t getSize() const override { return sizeof(ECExportThunkCode); };
void writeTo(uint8_t *buf) const override;
MachineTypes getMachine() const override { return AMD64; }
diff --git a/lld/test/COFF/build-id-sym.s b/lld/test/COFF/build-id-sym.s
index faed7bc40fd06..004a012cba0be 100644
--- a/lld/test/COFF/build-id-sym.s
+++ b/lld/test/COFF/build-id-sym.s
@@ -1,6 +1,6 @@
# REQUIRES: x86
# RUN: llvm-mc -triple=x86_64-windows-msvc -filetype=obj -o %t.obj %s
-# RUN: lld-link -debug:symtab -entry:main %t.obj -build-id -Brepro -out:%t.exe
+# RUN: lld-link -debug:symtab -entry:main %t.obj -build-id -Brepro -out:%t.exe -guard:cf
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
# Check __buildid points to 0x14000203c which is after the signature RSDS.
@@ -21,3 +21,6 @@ main:
.section .bss,"bw",discard,__buildid
.global __buildid
__buildid:
+
+.data
+.quad __buildid
|
mstorsjo
approved these changes
Mar 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
Mar 10, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
Mar 20, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
jph-13
pushed a commit
to jph-13/llvm-project
that referenced
this pull request
Mar 21, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
Apr 2, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
Apr 17, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
Apr 30, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
May 15, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
SquallATF
pushed a commit
to SquallATF/llvm-project
that referenced
this pull request
May 29, 2025
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in llvm#128440.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes
dyn_cast_or_null
usage inmaybeAddAddressTakenFunction
(#128440).