svn commit: r341054 - stable/11/libexec/rtld-elf

Konstantin Belousov kib at FreeBSD.org
Tue Nov 27 13:14:14 UTC 2018


Author: kib
Date: Tue Nov 27 13:14:13 2018
New Revision: 341054
URL: https://svnweb.freebsd.org/changeset/base/341054

Log:
  MFC r340675:
  rtld: when immediate bind mode is requested, process irelocs in PLT
  immediately after other PLT relocs.

Modified:
  stable/11/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/11/libexec/rtld-elf/rtld.c	Tue Nov 27 13:06:54 2018	(r341053)
+++ stable/11/libexec/rtld-elf/rtld.c	Tue Nov 27 13:14:13 2018	(r341054)
@@ -132,6 +132,7 @@ static int relocate_object(Obj_Entry *obj, bool bind_n
     int flags, RtldLockState *lockstate);
 static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int,
     RtldLockState *);
+static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *);
 static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now,
     int flags, RtldLockState *lockstate);
 static int rtld_dirname(const char *, char *);
@@ -2873,9 +2874,11 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent
 	if (reloc_plt(obj) == -1)
 		return (-1);
 	/* Relocate the jump slots if we are doing immediate binding. */
-	if (obj->bind_now || bind_now)
-		if (reloc_jmpslots(obj, flags, lockstate) == -1)
+	if (obj->bind_now || bind_now) {
+		if (reloc_jmpslots(obj, flags, lockstate) == -1 ||
+		    resolve_object_ifunc(obj, true, flags, lockstate) == -1)
 			return (-1);
+	}
 
 	/*
 	 * Process the non-PLT IFUNC relocations.  The relocations are


More information about the svn-src-stable-11 mailing list