This is the mail archive of the libc-alpha@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]

New TLS descriptors code vs. __i686.get_pc_thunk.bx


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

Attachment: signature.asc
Description: Digital signature


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