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

arm native code is thumb-aware, thus does crash (SIGILL) on thumbless ARM CPUs #5200

Closed
vicuna opened this issue Dec 20, 2010 · 3 comments
Closed
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 20, 2010

Original bug ID: 5200
Reporter: is
Assigned to: meurer
Status: closed (set by @xavierleroy on 2015-12-11T18:04:27Z)
Resolution: not a bug
Priority: normal
Severity: major
Version: 3.12.0
Category: ~DO NOT USE (was: OCaml general)
Tags: arm
Monitored by: is mehdi

Bug description

The ARM code uses "bx Rn" / "bx LR" to return to callers or call external functions. This is nice on Thumb-aware CPUs, because it allows to return to/call thumb code in these situations. However, bx is not available on thumbless CPUs like SA-110 (or any without the suffix "T").

For NetBSD/arm I've patched by replacing "bx Rn" with "mov PC,Rn". Patch files are appended. However, I think that you'll want some option to build either the one or the other version, else mixed thumb/arm code wouldn't interwork with OCaml... maybe introduce "armt" for the Thumb-aware variant?

File attachments

@vicuna
Copy link
Author

vicuna commented Dec 21, 2010

Comment author: is

Should this be category "ocaml general"? Can I change this?

@vicuna
Copy link
Author

vicuna commented Feb 22, 2012

Comment author: meurer

For ARM code to be EABI compliant we have to use BX (EABI requires interworking). It is the job of the linker to replace BX Rn with MOV PC, Rn when running on a pre-ARMv5T CPU.

Is this issue still relevant? Which NetBSD ARM port are you talking about exactly?

@vicuna
Copy link
Author

vicuna commented Apr 8, 2012

Comment author: @xavierleroy

In the absence of new information, I'm resolving this PR as "no change required" in OCaml.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant