Skip to content
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

[llvm-jitlink] Fix detectStubKind() for big endian systems #79970

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

weliveindetail
Copy link
Contributor

This function is used in jitlink-check lines in LIT tests. In #78371 I missed to swap initial instruction bytes for systems that store the constants as big-endian.

This function is used in jitlink-check lines for LIT testing. In llvm#78371 I missed to swap initial instruction bytes for systems that
store the constants as big-endian.
@weliveindetail
Copy link
Contributor Author

The issue was reported here: sx-aurora-dev/llvm-project@e5ca202#commitcomment-137959902

weliveindetail referenced this pull request in sx-aurora-dev/llvm-project Jan 30, 2024
We want to emit stubs that match the instruction set state of the
relocation site. This is important for branches that have no built-in
switch for the instruction set state. It's the case for Jump24
relocations. Relocations on instructions that support switching on
the fly will be rewritten in a relaxation step in the future. This
affects Call relocations on `BL`/`BLX` instructions.

In this patch, the StubManager gains a second stub symbol slot for each
target and selects which one to use based on the relocation type. For
testing, we select the appropriate slot with a stub-kind filter, i.e.
`arm` or `thumb`. With that we can implement Armv7 stubs and test
that we can have both kinds of stubs for a single external symbol.
@weliveindetail
Copy link
Contributor Author

FYI: The pre-merge build failed because the Windows bot is broken.

Copy link
Contributor

@maryammo maryammo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@weliveindetail weliveindetail merged commit 8a5bdd8 into llvm:main Jan 30, 2024
3 of 4 checks passed
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Jan 30, 2024
This function is used in `jitlink-check` lines in LIT tests. In llvm#78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd8)
@weliveindetail weliveindetail deleted the llvm-jitlink-check-be-fix branch January 30, 2024 17:08
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Feb 1, 2024
This function is used in `jitlink-check` lines in LIT tests. In llvm#78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd8)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
This function is used in `jitlink-check` lines in LIT tests. In llvm#78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd8)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
This function is used in `jitlink-check` lines in LIT tests. In llvm#78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd8)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
This function is used in `jitlink-check` lines in LIT tests. In llvm#78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd8)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
This function is used in `jitlink-check` lines in LIT tests. In llvm#78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd8)
@pointhex pointhex mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants