Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Aug 2018 20:43:50 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337436 - head/sys/kern
Message-ID:  <201808072043.w77Khook055529@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808072043.w77Khook055529>