Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2018 20:52:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 227093] powerpc64/pseries: Symbol table not relocated
Message-ID:  <bug-227093-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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.=



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