Module Name:    src
Committed By:   maya
Date:           Mon Apr 15 19:13:04 UTC 2019

Modified Files:
        src/libexec/ld.elf_so/arch/riscv: mdreloc.c

Log Message:
r_symndx is no longer declared, use symnum and initialize it before use.

Completes the changes in the commit:
"Replace COMBREL with just-in-time check in _rtld_relocate_nonplt_objects."
http://mail-index.netbsd.org/source-changes/2017/06/19/msg085496.html


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/libexec/ld.elf_so/arch/riscv/mdreloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/arch/riscv/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/riscv/mdreloc.c:1.4 src/libexec/ld.elf_so/arch/riscv/mdreloc.c:1.5
--- src/libexec/ld.elf_so/arch/riscv/mdreloc.c:1.4	Thu Aug 10 19:03:26 2017
+++ src/libexec/ld.elf_so/arch/riscv/mdreloc.c	Mon Apr 15 19:13:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdreloc.c,v 1.4 2017/08/10 19:03:26 joerg Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.5 2019/04/15 19:13:03 maya Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.4 2017/08/10 19:03:26 joerg Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.5 2019/04/15 19:13:03 maya Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -131,7 +131,8 @@ _rtld_relocate_nonplt_objects(Obj_Entry 
 			break;
 
 		case R_TYPE(RELATIVE): {
-			def = obj->symtab + r_symndx;
+			symnum = ELF_R_SYM(rela->r_info);
+			def = obj->symtab + symnum;
 
 			Elf_Addr val = (Elf_Addr)obj->relocbase + rela->r_addend;
 

Reply via email to