Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so/arch/powerpc - fix wrong reloc name in assert



details:   https://anonhg.NetBSD.org/src/rev/56016ee701f9
branches:  trunk
changeset: 447070:56016ee701f9
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 30 03:23:46 2018 +0000

description:
- fix wrong reloc name in assert
- fix uninitialized

diffstat:

 libexec/ld.elf_so/arch/powerpc/ppc_reloc.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 5d40aaf09c9a -r 56016ee701f9 libexec/ld.elf_so/arch/powerpc/ppc_reloc.c
--- a/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c        Sun Dec 30 01:54:13 2018 +0000
+++ b/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c        Sun Dec 30 03:23:46 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ppc_reloc.c,v 1.57 2018/04/03 21:10:27 joerg Exp $     */
+/*     $NetBSD: ppc_reloc.c,v 1.58 2018/12/30 03:23:46 christos Exp $  */
 
 /*-
  * Copyright (C) 1998  Tsubai Masanari
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ppc_reloc.c,v 1.57 2018/04/03 21:10:27 joerg Exp $");
+__RCSID("$NetBSD: ppc_reloc.c,v 1.58 2018/12/30 03:23:46 christos Exp $");
 #endif /* not lint */
 
 #include <stdarg.h>
@@ -188,6 +188,7 @@
                unsigned long    symnum;
 
                where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+               symnum = ELF_R_SYM(rela->r_info);
 
                switch (ELF_R_TYPE(rela->r_info)) {
 #ifdef _LP64
@@ -199,7 +200,6 @@
                case R_TYPE(DTPMOD):
                case R_TYPE(DTPREL):
                case R_TYPE(TPREL):
-                       symnum = ELF_R_SYM(rela->r_info);
                        if (last_symnum != symnum) {
                                last_symnum = symnum;
                                def = _rtld_find_symdef(symnum, obj, &defobj,
@@ -327,7 +327,7 @@
                size_t reloff = rela - obj->pltrela;
                Elf_Word *where = (Elf_Word *)(obj->relocbase + rela->r_offset);
 
-               assert(ELF_R_TYPE(rela->r_info) == R_TYPE(JUMP_SLOT) ||
+               assert(ELF_R_TYPE(rela->r_info) == R_TYPE(JMP_SLOT) ||
                       ELF_R_TYPE(rela->r_info) == R_TYPE(IRELATIVE));
 
                if (ELF_R_TYPE(rela->r_info) == R_TYPE(IRELATIVE)) {



Home | Main Index | Thread Index | Old Index