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

error: unknown register name 'r0' in asm #25

Open
ksaker opened this issue Nov 5, 2016 · 4 comments
Open

error: unknown register name 'r0' in asm #25

ksaker opened this issue Nov 5, 2016 · 4 comments

Comments

@ksaker
Copy link

ksaker commented Nov 5, 2016

When try to compile, i have an error:

[arm64-v8a] Compile : base <= hook.c
~/adbi/instruments/base/jni/../hook.c:43:5: error: unknown register name 'r0' in asm
: "r0", "r1", "r7"

@Invincibl-e
Copy link

use the gcc compiler

@ly0
Copy link

ly0 commented Mar 6, 2017

I have the same problem, using gcc compiler alone, it gave me these errors

/var/folders/vt/s88752xx00nfwvs7vcqy0sp00000gn/T//ccU0ihtI.s: Assembler messages:
/var/folders/vt/s88752xx00nfwvs7vcqy0sp00000gn/T//ccU0ihtI.s:46: Error: operand 1 should be an integer register -- `mov r0,x2'
/var/folders/vt/s88752xx00nfwvs7vcqy0sp00000gn/T//ccU0ihtI.s:47: Error: operand 1 should be an integer register -- `mov r1,x3'
/var/folders/vt/s88752xx00nfwvs7vcqy0sp00000gn/T//ccU0ihtI.s:48: Error: operand 1 should be an integer register -- `mov r7,x4'
/var/folders/vt/s88752xx00nfwvs7vcqy0sp00000gn/T//ccU0ihtI.s:49: Error: operand 1 should be an integer register -- `mov r2,#0x0'

@thinkhy
Copy link

thinkhy commented Mar 20, 2017

My solution is creating a Application.mk under the directory of jni:

APP_MODULES := base
APP_ABI := armeabi armeabi-v7a

@ly0
Copy link

ly0 commented Mar 21, 2017

ok. I found this project is not suitable for arm64, coz r0-r7 do not exist anymore, and x0-x7 instead.

And, if you wanna make this project work on arm64-v8a, some codes need to be edited, such as the inline assembly the compiler mentions, and codes about ELF32, the hook assembly codes, etc.

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

No branches or pull requests

4 participants