Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2018 13:06:54 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341053 - stable/12/libexec/rtld-elf
Message-ID:  <201811271306.wARD6sCV024476@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Nov 27 13:06:54 2018
New Revision: 341053
URL: https://svnweb.freebsd.org/changeset/base/341053

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

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

Modified: stable/12/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/12/libexec/rtld-elf/rtld.c	Tue Nov 27 13:00:51 2018	(r341052)
+++ stable/12/libexec/rtld-elf/rtld.c	Tue Nov 27 13:06:54 2018	(r341053)
@@ -134,6 +134,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 *);
@@ -2859,9 +2860,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



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