From owner-freebsd-bugs@freebsd.org Thu Mar 29 20:52:40 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEAD6F76285 for ; Thu, 29 Mar 2018 20:52:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA0A84958 for ; Thu, 29 Mar 2018 20:52:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 979B4273B9 for ; Thu, 29 Mar 2018 20:52:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TKqcgV079468 for ; Thu, 29 Mar 2018 20:52:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w2TKqcRC079467 for freebsd-bugs@FreeBSD.org; Thu, 29 Mar 2018 20:52:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 227093] powerpc64/pseries: Symbol table not relocated Date: Thu, 29 Mar 2018 20:52:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: breno.leitao@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 20:52:40 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227093 Bug ID: 227093 Summary: powerpc64/pseries: Symbol table not relocated Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: breno.leitao@gmail.com After the powerpc64 memory relocation code, the stack dumps on pseries does= not show the function names properly because the symbol table is not relocated. I created a patch that fixes it on the wrong way, i.e, masking the symbol address other than relocating the whole symbol table. This is the workaround I am using at this moment, but I will work to reloca= ted the symbol table and send it for review. diff --git a/sys/kern/subr_stack.c b/sys/kern/subr_stack.c index 0254c7f3fd0..dd767858f8e 100644 --- a/sys/kern/subr_stack.c +++ b/sys/kern/subr_stack.c @@ -264,7 +264,9 @@ stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset) linker_symval_t symval; c_linker_sym_t sym; - if (linker_ddb_search_symbol((caddr_t)pc, &sym, offset) !=3D 0) + caddr_t newpc =3D (caddr_t) (pc & 0x0fffffffffffffff); + + if (linker_ddb_search_symbol(newpc, &sym, offset) !=3D 0) goto out; if (linker_ddb_symbol_values(sym, &symval) !=3D 0) goto out; diff --git a/sys/powerpc/powerpc/db_trace.c b/sys/powerpc/powerpc/db_trace.c index a3ee988d438..68b886a68bc 100644 --- a/sys/powerpc/powerpc/db_trace.c +++ b/sys/powerpc/powerpc/db_trace.c @@ -284,7 +284,7 @@ db_backtrace(struct thread *td, db_addr_t fp, int count) } db_printf("at "); - db_printsym(lr, DB_STGY_PROC); + db_printsym(lr & 0x0fffffffffffffff, DB_STGY_PROC); if (full) /* Print all the args stored in that stackframe. */ db_printf("(%zx, %zx, %zx, %zx, %zx, %zx, %zx, %zx)= ", --=20 You are receiving this mail because: You are the assignee for the bug.=