Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2018 10:30:53 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341513 - head/libexec/rtld-elf/aarch64
Message-ID:  <201812051030.wB5AUrr7077925@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmel
Date: Wed Dec  5 10:30:53 2018
New Revision: 341513
URL: https://svnweb.freebsd.org/changeset/base/341513

Log:
  Tidy up arm64 reloc_jmpslots() implementation.
  - don't relocate jump slots multiple times (if LD_BIND_NOW is defined).
  - process only R_AARCH64_JUMP_SLOT here, other relocation types are handled
    by reloc_plt().
  
  MFC after:	1 week

Modified:
  head/libexec/rtld-elf/aarch64/reloc.c

Modified: head/libexec/rtld-elf/aarch64/reloc.c
==============================================================================
--- head/libexec/rtld-elf/aarch64/reloc.c	Wed Dec  5 10:23:38 2018	(r341512)
+++ head/libexec/rtld-elf/aarch64/reloc.c	Wed Dec  5 10:30:53 2018	(r341513)
@@ -243,8 +243,10 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat
 	const Elf_Rela *relalim;
 	const Elf_Rela *rela;
 	const Elf_Sym *def;
-	struct tls_data *tlsdesc;
 
+	if (obj->jmpslots_done)
+		return (0);
+
 	relalim = (const Elf_Rela *)((const char *)obj->pltrela +
 	    obj->pltrelasize);
 	for (rela = obj->pltrela; rela < relalim; rela++) {
@@ -265,20 +267,9 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat
 			reloc_jmpslot(where, target, defobj, obj,
 			    (const Elf_Rel *)rela);
 			break;
-		case R_AARCH64_TLSDESC:
-			if (ELF_R_SYM(rela->r_info) != 0) {
-				tlsdesc = (struct tls_data *)where[1];
-				if (tlsdesc->index == -1)
-					rtld_tlsdesc_handle_locked(tlsdesc,
-					    SYMLOOK_IN_PLT | flags, lockstate);
-			}
-			break;
-		default:
-			_rtld_error("Unknown relocation type %x in jmpslot",
-			    (unsigned int)ELF_R_TYPE(rela->r_info));
-			return (-1);
 		}
 	}
+	obj->jmpslots_done = true;
 
 	return (0);
 }



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