This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/20004] New: swapcontext for powerpc64 has an instruction missing


https://sourceware.org/bugzilla/show_bug.cgi?id=20004

            Bug ID: 20004
           Summary: swapcontext for powerpc64 has an instruction missing
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: segher at gcc dot gnu.org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

The GCC c-c++-common/asan/swapcontext-test-1.c test fails because
the glibc code does a wild memory access.  The following should fix
it (but I haven't actually tested it):

===
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
index a166dcc..ccad1f9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -163,6 +163,7 @@ ENTRY(__novec_swapcontext)
   cmpdi r0,0
   bne    L(nv_do_sigret)

+  ld    r8,.LC__dl_hwcap@toc(r2)
 # ifdef SHARED
 /* Load _rtld-global._dl_hwcap.  */
   ld    r8,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r8)
===

Also, in my configuration (with _ARCH_PWR6 defined) r8 isn't used
at all anyway.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]