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/20277] New: $dp is not initialized correctly in sysdeps/hppa/start.S


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

            Bug ID: 20277
           Summary: $dp is not initialized correctly in
                    sysdeps/hppa/start.S
           Product: glibc
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: danglin at gcc dot gnu.org
                CC: carlos at redhat dot com, deller at gmx dot de,
                    drepper.fsp at gmail dot com
  Target Milestone: ---
              Host: hppa-unknown-linux-gnu
            Target: hppa-unknown-linux-gnu
             Build: hppa-unknown-linux-gnu

With 2.22 and later, all programs compiled with -p profiling option crash
at startup.  For example, 

dave@mx3210:~/profile$ cat xxx.c
int
main (void)
{
  return 0;
}
dave@mx3210:~/profile$ ./xxx-p
Illegal instruction (core dumped)

dave@mx3210:~/profile$ gdb xxx-p
GNU gdb (Debian 7.11.1-2) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from xxx-p...(no debugging symbols found)...done.
(gdb) disass _start
Dump of assembler code for function _start:
   0x0001051c <+0>:     stw r0,-4(sp)
   0x00010520 <+4>:     stw rp,-14(sp)
   0x00010524 <+8>:     ldo 40(sp),sp
   0x00010528 <+12>:    stw sp,-4(sp)
   0x0001052c <+16>:    stw r19,-20(sp)
   0x00010530 <+20>:    stw r23,-38(sp)
   0x00010534 <+24>:    addil L%0,dp,r1
   0x00010538 <+28>:    ldw 9c(r1),r26
   0x0001053c <+32>:    ldw 0(r26),r26
   0x00010540 <+36>:    addil L%0,dp,r1
   0x00010544 <+40>:    ldw a0(r1),r23
   0x00010548 <+44>:    ldw 0(r23),r23
   0x0001054c <+48>:    addil L%0,dp,r1
   0x00010550 <+52>:    ldw a4(r1),r22
   0x00010554 <+56>:    ldw 0(r22),r22
   0x00010558 <+60>:    stw r22,-34(sp)
   0x0001055c <+64>:    stw sp,-3c(sp)
   0x00010560 <+68>:    addil L%0,dp,r1
   0x00010564 <+72>:    ldw a8(r1),dp
   0x00010568 <+76>:    b,l 0x104dc,rp
   0x0001056c <+80>:    nop
   0x00010570 <+84>:    iitlbp r0,(sr0,r0)
---Type <return> to continue, or q <return> to quit---
   0x00010574 <+88>:    nop
End of assembler dump.
(gdb) break *0x00010568
Breakpoint 1 at 0x10568
(gdb) r
Starting program: /home/dave/profile/xxx-p 

Breakpoint 1, 0x00010568 in _start ()
(gdb) stepi
0x0001056c in _start ()
(gdb) 
0x000104dc in ?? ()
(gdb) disass $pc,$pc+16
Dump of assembler code from 0x104dc to 0x104ec:
=> 0x000104dc:  addil L%0,dp,r1
   0x000104e0:  ldw 38(r1),r21
   0x000104e4:  bv r0(r21)
   0x000104e8:  ldw 3c(r1),r19
End of assembler dump.
(gdb) stepi
0x000104e0 in ?? ()
(gdb) 
0x000104e4 in ?? ()
(gdb) 
0x000104e8 in ?? ()
(gdb) 
0x00011000 in __init_array_start ()
(gdb) 

Program received signal SIGILL, Illegal instruction.
0x00011000 in __init_array_start ()

I believe this was introduced by a change in how gcrt1.o is assembled.  SHARED
is now defined.

-- 
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]