From patchwork Wed Oct 29 17:57:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Senkevich X-Patchwork-Id: 3480 Received: (qmail 14586 invoked by alias); 29 Oct 2014 17:58:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 14576 invoked by uid 89); 29 Oct 2014 17:58:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f54.google.com X-Received: by 10.229.7.133 with SMTP id d5mr18345195qcd.24.1414605487402; Wed, 29 Oct 2014 10:58:07 -0700 (PDT) MIME-Version: 1.0 From: Andrew Senkevich Date: Wed, 29 Oct 2014 21:57:37 +0400 Message-ID: Subject: [PATCH] i686: Fix test suite fails on build by gcc 5.0 To: libc-alpha Hi, this patch fixes 3 make check fails on glibc 32bit built by gcc 5.0 due to EBX was enabled for allocation (https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00892.html). Tests elf/tst-tls3, elf/tst-execstack-needed, elf/tst-execstack-prog failed because EBX was used as PIC register. ChangeLog: 2014-10-29 Andrew Senkevich * sysdeps/i386/tls-macros.h (TLS_IE, TLS_LD, TLS_GD): Remove PIC case. * sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Keep define only if gcc version < 5.0 --- WBR, Andrew diff --git a/sysdeps/i386/tls-macros.h b/sysdeps/i386/tls-macros.h index 0b85738..b5919d6 100644 --- a/sysdeps/i386/tls-macros.h +++ b/sysdeps/i386/tls-macros.h @@ -5,14 +5,6 @@ : "=r" (__l)); \ __l; }) -#ifdef PIC -# define TLS_IE(x) \ - ({ int *__l; \ - asm ("movl %%gs:0,%0\n\t" \ - "subl " #x "@gottpoff(%%ebx),%0" \ - : "=r" (__l)); \ - __l; }) -#else # define TLS_IE(x) \ ({ int *__l, __b; \ asm ("call 1f\n\t" \ @@ -25,17 +17,7 @@ "subl " #x "@gottpoff(%%ebx),%0" \ : "=r" (__l), "=&b" (__b)); \ __l; }) -#endif -#ifdef PIC -# define TLS_LD(x) \ - ({ int *__l, __c, __d; \ - asm ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \ - "call ___tls_get_addr@plt\n\t" \ - "leal " #x "@dtpoff(%%eax), %%eax" \ - : "=a" (__l), "=&c" (__c), "=&d" (__d)); \ - __l; }) -#else # define TLS_LD(x) \ ({ int *__l, __b, __c, __d; \ asm ("call 1f\n\t" \ @@ -49,17 +31,7 @@ "leal " #x "@dtpoff(%%eax), %%eax" \ : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \ __l; }) -#endif -#ifdef PIC -# define TLS_GD(x) \ - ({ int *__l, __c, __d; \ - asm ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \ - "call ___tls_get_addr@plt\n\t" \ - "nop" \ - : "=a" (__l), "=&c" (__c), "=&d" (__d)); \ - __l; }) -#else # define TLS_GD(x) \ ({ int *__l, __b, __c, __d; \ asm ("call 1f\n\t" \ @@ -73,4 +45,3 @@ "nop" \ : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \ __l; }) -#endif diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 57d5ea0..bce5697 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -502,7 +502,7 @@ asm (".L__X'%ebx = 1\n\t" #endif /* Consistency check for position-independent code. */ -#ifdef __PIC__ +#if defined __PIC__ && !__GNUC_PREREQ (5,0) # define check_consistency() \ ({ int __res; \ __asm__ __volatile__ \