This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Info on LinuxPPC make check failure in elf/vismain
- To: geoffk at cygnus dot com, howarth at bromo dot med dot uc dot edu
- Subject: Info on LinuxPPC make check failure in elf/vismain
- From: "Kevin B. Hendricks" <kevin dot hendricks at sympatico dot ca>
- Date: Tue, 15 Aug 2000 09:31:40 -0400
- CC: libc-alpha at sourceware dot cygnus dot com
- Reply-To: khendricks at ivey dot uwo dot ca
Hi Geoff,
I tried to send this directly to libc-alpha but sympatico's smtp1 server is on
some open-relay list someplace and it gets rejected. Hopefully this will make
it through to you.
I need help trying to understand the elf/vismain.c make check failure on
LinuxPPC from 2.1.92. Unfortunately, I am no expert on the dynamic linking
process but here is what gdb says is happening:
the elf/vismain check fails with an illegal instruction signal.
in do_test in vismain.c is the line val = protlocal() + calllocal1 () +
calllocal2 ();
In vismod1.c, calllocal1() calls protlocal() but the place where is the call to
protlocal should be done, the branch is to someplace out into the weeds
resulting in the sig illegal.
Here is a short code snippet of vismod1.c. Unfortunately, I don't know anything
about what the asm(".protected protlocal") does.
int
protlocal (void)
{
return 0x4;
}
asm (".protected protlocal");
int
calllocal1 (void)
{
return protlocal () + 0x10;
}
Interestingly enough, when you ask gdb to disassemble protlocal you get:
(gdb) disassemble protlocal
Dump of assembler code for function protlocal:
0x100018a8 <protlocal>: li r3,1
0x100018ac <protlocal+4>: blr
End of assembler dump.
(gdb)
The value protlocal shoudl be returning is 4 and not 1 unless the "protected
somehow hides that protlocal" and there is some other protlocal() someplace.
Here is what gdb says:
[root@localhost elf]# gdb vismain core
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "powerpc-unknown-linux-gnu"...
(no debugging symbols found)...
warning: core file may not match specified executable file.
Core was generated by `../elf/ld.so.1 --library-path
..:../math:.:../dlfcn:../nss:../nis:../rt:../reso'.
Program terminated with signal 4, Illegal instruction.
Reading symbols from /space/src/glibc-2.1.92/elf/./vismod3.so...
(no debugging symbols found)...done.
Loaded symbols for /space/src/glibc-2.1.92/elf/./vismod3.so
Reading symbols from /space/src/glibc-2.1.92/elf/./vismod1.so...
(no debugging symbols found)...done.
Loaded symbols for /space/src/glibc-2.1.92/elf/./vismod1.so
Reading symbols from /space/src/glibc-2.1.92/elf/./vismod2.so...
(no debugging symbols found)...done.
Loaded symbols for /space/src/glibc-2.1.92/elf/./vismod2.so
Reading symbols from /space/src/glibc-2.1.92/elf/../libc.so.6...done.
Loaded symbols for /space/src/glibc-2.1.92/elf/../libc.so.6
Reading symbols from /space/src/glibc-2.1.92/elf/../elf/ld.so.1...done.
Loaded symbols for /space/src/glibc-2.1.92/elf/../elf/ld.so.1
#0 0xffbe000 in ?? () from /space/src/glibc-2.1.92/elf/./vismod1.so
(gdb) bt
#0 0xffbe000 in ?? () from /space/src/glibc-2.1.92/elf/./vismod1.so
(gdb) info registers
r0 0x10001308 268440328
r1 0x7ffff9c0 2147482048
r2 0xc15fc000 -1050689536
r3 0x10 16
r4 0xff7b7df 267892703
r5 0x1 1
r6 0xfefefeff -16843009
r7 0x7f7f7f7f 2139062143
r8 0x80 128
r9 0xff7b7df 267892703
r10 0xff7b4dc 267891932
r11 0x7ffff990 2147482000
r12 0x22222248 572662344
r13 0x1001a288 268542600
r14 0x0 0
r15 0x100ac410 269141008
r16 0x0 0
r17 0x7ffff988 2147481992
r18 0x0 0
r19 0x0 0
r20 0xffffffff -1
r21 0x100dbc90 269335696
r22 0x100dc710 269338384
r23 0x0 0
r24 0x0 0
r25 0x10001948 268441928
r26 0x80292cc 134386380
r27 0xff86cd8 267939032
r28 0x1 1
r29 0x1 1
r30 0x2 2
r31 0x0 0
pc 0xffbe000 268165120
ps 0x8d032 577586
cr 0x22222248 572662344
lr 0xffbe9d8 268167640
ctr 0xffbe9c8 268167624
xer 0x0 0
(gdb) disassemble $lr
Dump of assembler code for function calllocal1:
0xffbe9c8 <calllocal1>: stwu r1,-16(r1)
0xffbe9cc <calllocal1+4>: mflr r0
0xffbe9d0 <calllocal1+8>: stw r0,20(r1)
0xffbe9d4 <calllocal1+12>: bl 0xffbe000
0xffbe9d8 <calllocal1+16>: addi r3,r3,16
0xffbe9dc <calllocal1+20>: lwz r0,20(r1)
0xffbe9e0 <calllocal1+24>: mtlr r0
0xffbe9e4 <calllocal1+28>: addi r1,r1,16
0xffbe9e8 <calllocal1+32>: blr
End of assembler dump.
(gdb) disassemble 0xffbe00
No function contains specified address.
And Here is what objdump -d says about vismod1.so
00000858 <_init>:
858: 94 21 ff f0 stwu r1,-16(r1)
85c: 7c 08 02 a6 mflr r0
860: 90 01 00 14 stw r0,20(r1)
864: 48 01 05 2d bl 10d90 <__bss_start+0x58>
868: 48 00 00 e9 bl 950 <frame_dummy>
86c: 48 00 03 15 bl b80 <__do_global_ctors_aux>
870: 80 01 00 14 lwz r0,20(r1)
874: 7c 08 03 a6 mtlr r0
878: 38 21 00 10 addi r1,r1,16
87c: 4e 80 00 20 blr
Disassembly of section .text:
*snip*
000009b8 <protlocal>:
9b8: 94 21 ff f0 stwu r1,-16(r1)
9bc: 38 60 00 04 li r3,4
9c0: 38 21 00 10 addi r1,r1,16
9c4: 4e 80 00 20 blr
000009c8 <calllocal1>:
9c8: 94 21 ff f0 stwu r1,-16(r1)
9cc: 7c 08 02 a6 mflr r0
9d0: 90 01 00 14 stw r0,20(r1)
9d4: 4b ff f6 2d bl 0 <_init-0x858>
9d8: 38 63 00 10 addi r3,r3,16
9dc: 80 01 00 14 lwz r0,20(r1)
9e0: 7c 08 03 a6 mtlr r0
9e4: 38 21 00 10 addi r1,r1,16
9e8: 4e 80 00 20 blr
I could really use some ideas here to help figure this out. I would be happy to
provide more info if anyone needs it.
Thanks,
Kevin