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

i#4304 unexpected_return unreachable on aarch64: Use long branch #6566

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

xdje42
Copy link
Contributor

@xdje42 xdje42 commented Jan 17, 2024

Fix i#4304 in a different way by always using a branch/call instruction with enough bits of offset to reach the unexpected_return function. Conditional branches don't always have enough offsets to branch to any function within a binary: they're generally only intended for branching within a single function. On aarch64 conditional branch instructions have 19 bits of offset and unconditional branch and call instructions have 26 bits, and is used for every other function call so we should be good for awhile.

Fixes #4304

Fix i#4304 in a different way by always using a branch/call instruction
with enough bits of offset to reach the unexpected_return function.
Conditional branches don't always have enough offsets to branch to
any function within a binary: they're generally only intended for
branching within a single function. On aarch64 conditional branch
instructions have 19 bits of offset and unconditional branch and
call instructions have 26 bits, and is used for every other function call
so we should be good for awhile.

Fixes #4304
@xdje42 xdje42 requested a review from derekbruening January 19, 2024 04:31
@xdje42
Copy link
Contributor Author

xdje42 commented Jan 19, 2024

The failing tests are not related to the patch.

core/arch/aarch64/aarch64.asm Show resolved Hide resolved
core/arch/aarch64/aarch64.asm Show resolved Hide resolved
core/drlibc/drlibc_xarch.asm Outdated Show resolved Hide resolved
core/drlibc/drlibc_xarch.asm Outdated Show resolved Hide resolved
core/drlibc/drlibc_xarch.asm Outdated Show resolved Hide resolved
xdje42 and others added 2 commits January 19, 2024 11:38
Fix i#4304 in a different way by always using a branch/call instruction
with enough bits of offset to reach the unexpected_return function.
Conditional branches don't always have enough offsets to branch to
any function within a binary: they're generally only intended for
branching within a single function. On aarch64 conditional branch
instructions have 19 bits of offset and unconditional branch and
call instructions have 26 bits, and are used for every other function call
so we should be good for a while.

Fixes #4304
@derekbruening derekbruening merged commit e4da1a7 into master Jan 23, 2024
13 of 15 checks passed
@derekbruening derekbruening deleted the i4304-use-long-branch branch January 23, 2024 04:00
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.

AArch64 static DR link error: relocation out of range for unexpected_return
2 participants