IA64 bug with -z defs
Ian Wienand
ianw@gelato.unsw.edu.au
Thu Jun 17 06:03:00 GMT 2004
Hi,
This recently came up from a problem with gnome stuff in Debian on
IA64. Basically, a developer added -Wl,-z,defs to a build, and IA64
broke.
Looking into it, say you have a simple shared library
--- l.c ---
int fn(int i)
{
return notfound(i+1)
}
---
and do this
$ gcc -g -shared -o libl.so l.c
$ gcc -g -Wl,-z,defs -shared -o libl.bad.so l.c
/tmp/ccCYI3Wd.o(.text+0x42): In function `fn':
/usr/src/binutils-test/l.c:3: warning: undefined reference to `notfound'
$ objdump --disassemble libl.so > good.dump
$ objdump --disassemble libl.bad.so > bad.dump
$ diff -u good.dump bad.dump
--- good.dump 2004-06-17 15:41:17.798943503 +1000
+++ bad.dump 2004-06-17 15:41:26.838005893 +1000
@@ -1,5 +1,5 @@
-libl.so: file format elf64-ia64-little
+libl.bad.so: file format elf64-ia64-little
Disassembly of section .init:
@@ -154,7 +154,7 @@
c5c: 00 00 04 00 nop.i 0x0
c60: 1c 00 00 00 01 00 [MFB] nop.m 0x0
c66: 00 00 00 02 00 00 nop.f 0x0
- c6c: c8 fd ff 58 br.call.sptk.many b0=a20 <_init+0xa0>
+ c6c: 08 00 00 50 br.call.sptk.many b0=c60 <fn+0x40>
c70: 02 08 00 48 00 21 [MII] mov r1=r36
c76: e0 00 20 00 42 00 mov r14=r8;;
c7c: 01 70 00 84 mov r8=r14
So, as far as I can tell, the undefined reference when using -z defs
never ends up with a PLT slot (that's the branch to _init, right?) but
just loops back to it's self. This was exactly the problem we were
seeing (programs would just sit and hang).
Doing the same thing on i386 results in both 'bad' and 'good' looking
exactly the same, so I assume it's an IA64 bug.
-i
ianw@gelato.unsw.edu.au
http://www.gelato.unsw.edu.au
(I had a quick look at the code, but quickly established it would take
me forever to figure out what is going on.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20040617/a529c545/attachment.sig>
More information about the Binutils
mailing list