From: Marcus Shawcroft <marcus.shawcroft@linaro.org>
To: libc-ports@sourceware.org
Subject: [PATCH][AArch64] Fix link error for ioctl syscall wrapper.
Date: Sun, 12 May 2013 12:00:00 -0000 [thread overview]
Message-ID: <CABXK9nctRBZzhMYWs71mqmFNoA7dnnQD23V5nFYLjVXC8cXkiw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 863 bytes --]
Hello,
The ioctl() and clone() system call wrappers for AArch64 are currently written
to use a conditional branch to reach the sycall error handler when the
relevant system call returns an error value. The use of conditional
branch for this purpose is inappropriate due to the limited range of
these instructions. The generated syscall wrappers take care to use
the unconditional branch form, which has greater range.
This patch corrects the behavior of both wrappers.
I shall commit this patch shortly.
/Marcus
Proposed ChangeLog:
2013-05-12 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/unix/sysv/linux/aarch64/clone.S (__clone):
Do not call sycall_error directly with a confitional branch.
* sysdeps/unix/sysv/linux/aarch64/ioctl.S (__ioctl):
Do not call sycall_error directly with a confitional branch.
[-- Attachment #2: glibc-cb-syscall-error.diff --]
[-- Type: application/octet-stream, Size: 858 bytes --]
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/clone.S b/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
index 999ecf2..b359e6e 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
@@ -65,9 +65,10 @@ ENTRY(__clone)
svc 0x0
cmp x0, #0
beq 2f
- blt C_SYMBOL_NAME(__syscall_error)
+ blt 3f
RET
1: mov x0, #-EINVAL
+3:
b syscall_error
2:
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S
index b089bb5..2e08cf7 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S
@@ -24,9 +24,7 @@ ENTRY(__ioctl)
sxtw x0, w0
svc #0x0
cmn x0, #0x1, lsl #12
- b.hi C_SYMBOL_NAME(__syscall_error)
- ret
-
+ PSEUDO_RET
PSEUDO_END (__ioctl)
weak_alias (__ioctl, ioctl)
reply other threads:[~2013-05-12 12:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABXK9nctRBZzhMYWs71mqmFNoA7dnnQD23V5nFYLjVXC8cXkiw@mail.gmail.com \
--to=marcus.shawcroft@linaro.org \
--cc=libc-ports@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).