Do not use b.cs instruction to jump to cerror.
The conditional jump can only be performed to targets up to 1MB in either direction and does not work too well when linker places cerror further that that from the caller. In that case linker will complain about relocation overflows. Reviewed by: emaste, andrew Differential Revision: https://reviews.freebsd.org/D10305
This commit is contained in:
parent
fc5bae39c0
commit
07b49497db
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316624
@ -45,12 +45,19 @@ ENTRY(__sys_##name); \
|
|||||||
ret; \
|
ret; \
|
||||||
END(__sys_##name)
|
END(__sys_##name)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Conditional jumps can only go up to one megabyte in either
|
||||||
|
* direction, and cerror can be located anywhere, so we have
|
||||||
|
* to jump around to use more capable unconditional branch
|
||||||
|
* instruction.
|
||||||
|
*/
|
||||||
#define PSEUDO(name) \
|
#define PSEUDO(name) \
|
||||||
ENTRY(__sys_##name); \
|
ENTRY(__sys_##name); \
|
||||||
WEAK_REFERENCE(__sys_##name, _##name); \
|
WEAK_REFERENCE(__sys_##name, _##name); \
|
||||||
_SYSCALL(name); \
|
_SYSCALL(name); \
|
||||||
b.cs cerror; \
|
b.cs 1f; \
|
||||||
ret; \
|
ret; \
|
||||||
|
1: b cerror; \
|
||||||
END(__sys_##name)
|
END(__sys_##name)
|
||||||
|
|
||||||
#define RSYSCALL(name) \
|
#define RSYSCALL(name) \
|
||||||
@ -58,6 +65,7 @@ ENTRY(__sys_##name); \
|
|||||||
WEAK_REFERENCE(__sys_##name, name); \
|
WEAK_REFERENCE(__sys_##name, name); \
|
||||||
WEAK_REFERENCE(__sys_##name, _##name); \
|
WEAK_REFERENCE(__sys_##name, _##name); \
|
||||||
_SYSCALL(name); \
|
_SYSCALL(name); \
|
||||||
b.cs cerror; \
|
b.cs 1f; \
|
||||||
ret; \
|
ret; \
|
||||||
|
1: b cerror; \
|
||||||
END(__sys_##name)
|
END(__sys_##name)
|
||||||
|
Loading…
Reference in New Issue
Block a user