Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 517626 Details for
Bug 518130
>sys-devel/gcc-4.5 causes GDB stops at 0 address on ia64
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-ia64-fix-ptrace-PTRACE_GETREGS-unbreaks-strace-gdb.patch
0001-ia64-fix-ptrace-PTRACE_GETREGS-unbreaks-strace-gdb.patch (text/plain), 3.16 KB, created by
Sergei Trofimovich (RETIRED)
on 2018-02-02 22:21:05 UTC
(
hide
)
Description:
0001-ia64-fix-ptrace-PTRACE_GETREGS-unbreaks-strace-gdb.patch
Filename:
MIME Type:
Creator:
Sergei Trofimovich (RETIRED)
Created:
2018-02-02 22:21:05 UTC
Size:
3.16 KB
patch
obsolete
>From 4603470f1478d3f3a145d919c61c0fc9eaa88315 Mon Sep 17 00:00:00 2001 >From: Sergei Trofimovich <slyfox@gentoo.org> >Date: Fri, 2 Feb 2018 21:36:33 +0000 >Subject: [PATCH] ia64: fix ptrace(PTRACE_GETREGS) (unbreaks strace, gdb) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The strace breakage looks like that: >./strace: get_regs: get_regs_error: Input/output error > >It happens because ia64 needs to load unwind tables >to read certain registers. Unwind tables fail to load >due to GCC quirk on the following code: > > extern char __end_unwind[]; > const struct unw_table_entry *end = (struct unw_table_entry *)table_end; > table->end = segment_base + end[-1].end_offset; > >GCC does not generate correct code for this single memory >reference after constant propagation (see https://gcc.gnu.org/PR84184). >Two triggers are required for bad code generation: >- '__end_unwind' has alignment lower (char), than > 'struct unw_table_entry' (8). >- symbol offset is negative. > >This commit workarounds it by fixing alignment of '__end_unwind'. >While at it use hidden symbols to generate shorter gp-relative >relocations. > >CC: Tony Luck <tony.luck@intel.com> >CC: Fenghua Yu <fenghua.yu@intel.com> >CC: linux-ia64@vger.kernel.org >CC: linux-kernel@vger.kernel.org >Bug: https://github.com/strace/strace/issues/33 >Bug: https://gcc.gnu.org/PR84184 >Reported-by: Ãmeric Maschino <emeric.maschino@gmail.com> >Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> >--- > arch/ia64/include/asm/sections.h | 1 - > arch/ia64/kernel/unwind.c | 15 ++++++++++++++- > 2 files changed, 14 insertions(+), 2 deletions(-) > >diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h >index f3481408594e..0fc4f1757a44 100644 >--- a/arch/ia64/include/asm/sections.h >+++ b/arch/ia64/include/asm/sections.h >@@ -24,7 +24,6 @@ extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchli > extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; > extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; > extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; >-extern char __start_unwind[], __end_unwind[]; > extern char __start_ivt_text[], __end_ivt_text[]; > > #undef dereference_function_descriptor >diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c >index e04efa088902..025ba6700790 100644 >--- a/arch/ia64/kernel/unwind.c >+++ b/arch/ia64/kernel/unwind.c >@@ -2243,7 +2243,20 @@ __initcall(create_gate_table); > void __init > unw_init (void) > { >- extern char __gp[]; >+ #define __ia64_hidden __attribute__((visibility("hidden"))) >+ /* >+ * We use hidden symbols to generate more efficient code using >+ * gp-relative addressing. >+ */ >+ extern char __gp[] __ia64_hidden; >+ /* >+ * Unwind tables need to have proper alignment as init_unwind_table() >+ * uses negative offsets against '__end_unwind'. >+ * See https://gcc.gnu.org/PR84184 >+ */ >+ extern const struct unw_table_entry __start_unwind[] __ia64_hidden; >+ extern const struct unw_table_entry __end_unwind[] __ia64_hidden; >+ #undef __ia64_hidden > extern void unw_hash_index_t_is_too_narrow (void); > long i, off; > >-- >2.16.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 518130
: 517626