From owner-svn-src-head@freebsd.org Tue Aug 7 20:43:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3F7106AB96; Tue, 7 Aug 2018 20:43:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C99BE80FB3; Tue, 7 Aug 2018 20:43:50 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAE7420D76; Tue, 7 Aug 2018 20:43:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77KhoYK055530; Tue, 7 Aug 2018 20:43:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Khook055529; Tue, 7 Aug 2018 20:43:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808072043.w77Khook055529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 20:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337436 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 20:43:51 -0000 Author: kib Date: Tue Aug 7 20:43:50 2018 New Revision: 337436 URL: https://svnweb.freebsd.org/changeset/base/337436 Log: Followup to r337430: only call elf_reloc_ifunc on x86. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Aug 7 19:23:03 2018 (r337435) +++ head/sys/kern/link_elf_obj.c Tue Aug 7 20:43:50 2018 (r337436) @@ -485,10 +485,12 @@ link_elf_link_preload_finish(linker_file_t lf) if (error) return (error); +#if defined(__i386__) || defined(__amd64__) /* Now ifuncs. */ error = link_elf_reloc_local(lf, true); if (error != 0) return (error); +#endif /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -994,10 +996,12 @@ link_elf_load_file(linker_class_t cls, const char *fil if (error) goto out; +#if defined(__i386__) || defined(__amd64__) /* Now ifuncs. */ error = link_elf_reloc_local(lf, true); if (error != 0) goto out; +#endif /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -1521,9 +1525,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) ifuncs) elf_reloc_local(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) else if (ifuncs) elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); +#endif } } @@ -1552,9 +1558,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) ifuncs) elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) else if (ifuncs) elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); +#endif } } return (0);