New TLS descriptors code vs. __i686.get_pc_thunk.bx
Thomas Schwinge
tschwinge@gnu.org
Mon Nov 24 15:00:00 GMT 2008
Hello!
When building glibc for i586-pc-gnu, I hit the following problem.
If sysdeps/i386/i686/memcmp.S isn't used (as in a i586 compilation),
__i686.get_pc_thunk.bx will be undefined, resulting in a compilation
error in the new TLS descriptors code (Alexandre Oliva).
The following bit of code is duplicated from sysdeps/i386/sysdep.h's
SETUP_PIC_REG macro definition. It is also defined in
sysdeps/i386/i686/memcmp.S, but only used in the i686 case, as already
said. Perhaps it should be put into a more general place? Why the
__i686 prefix? And why don't other architectures see this problem for
i586, oder do they? Any reading pointers welcome.
2008-11-24 Thomas Schwinge <tschwinge@gnu.org>
* sysdeps/i386/d-tlsdesc.S (__i686.get_pc_thunk.bx): New definition,
if not already defined.
diff --git a/sysdeps/i386/dl-tlsdesc.S b/sysdeps/i386/dl-tlsdesc.S
index db5005d..a78f332 100644
--- a/sysdeps/i386/dl-tlsdesc.S
+++ b/sysdeps/i386/dl-tlsdesc.S
@@ -135,6 +135,18 @@ _dl_tlsdesc_dynamic:
jmp .Lret
cfi_endproc
.size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
+
+ .ifndef __i686.get_pc_thunk.bx;
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits;
+ .globl __i686.get_pc_thunk.bx;
+ .hidden __i686.get_pc_thunk.bx;
+ .type __i686.get_pc_thunk.bx,@function;
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx;
+ ret;
+ .size __i686.get_pc_thunk.bx, . - __i686.get_pc_thunk.bx;
+ .previous;
+ .endif;
#endif /* SHARED */
/* This function is a wrapper for a lazy resolver for TLS_DESC
Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20081124/cb7ca982/attachment.sig>
More information about the Libc-alpha
mailing list