From owner-svn-src-all@freebsd.org Fri Apr 7 22:58:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7CC9D322FE; Fri, 7 Apr 2017 22:58:21 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995C9197; Fri, 7 Apr 2017 22:58:21 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v37MwKtb004885; Fri, 7 Apr 2017 22:58:20 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v37MwKN3004884; Fri, 7 Apr 2017 22:58:20 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201704072258.v37MwKN3004884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Fri, 7 Apr 2017 22:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316624 - head/lib/libc/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2017 22:58:22 -0000 Author: kan Date: Fri Apr 7 22:58:20 2017 New Revision: 316624 URL: https://svnweb.freebsd.org/changeset/base/316624 Log: 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 Modified: head/lib/libc/aarch64/SYS.h Modified: head/lib/libc/aarch64/SYS.h ============================================================================== --- head/lib/libc/aarch64/SYS.h Fri Apr 7 21:06:50 2017 (r316623) +++ head/lib/libc/aarch64/SYS.h Fri Apr 7 22:58:20 2017 (r316624) @@ -45,12 +45,19 @@ ENTRY(__sys_##name); \ ret; \ 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) \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ - b.cs cerror; \ + b.cs 1f; \ ret; \ +1: b cerror; \ END(__sys_##name) #define RSYSCALL(name) \ @@ -58,6 +65,7 @@ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ - b.cs cerror; \ + b.cs 1f; \ ret; \ +1: b cerror; \ END(__sys_##name)