From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4139 invoked by alias); 1 Apr 2003 19:45:13 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 4095 invoked from network); 1 Apr 2003 19:45:12 -0000 Received: from unknown (HELO localhost.localdomain) (195.113.19.66) by sources.redhat.com with SMTP; 1 Apr 2003 19:45:12 -0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h31Jj4qO015435; Tue, 1 Apr 2003 21:45:04 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.12.8/8.12.8/Submit) id h31Jj4po015431; Tue, 1 Apr 2003 21:45:04 +0200 Date: Tue, 01 Apr 2003 19:45:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix IA-64 tls-macros.h Message-ID: <20030401194503.GL16629@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-04/txt/msg00006.txt.bz2 Hi! We have to tell gc those 3 asm's use gp, because otherwise when optimizing there might be a gp value from last called function in gp instead of current function's got pointer. 2003-04-01 Jakub Jelinek * elf/tls-macros.h [__ia64__] (TLS_IE, TLS_LD, TLS_GD): Add gp register as input to asm. --- libc/elf/tls-macros.h.jj 2003-03-02 06:41:54.000000000 -0500 +++ libc/elf/tls-macros.h 2003-04-01 14:31:13.000000000 -0500 @@ -316,13 +316,14 @@ register void *__gp __asm__("$29"); # define TLS_IE(x) \ ({ void *__l; \ + register long __gp asm ("gp"); \ asm (";;\n\t" \ "addl r16=@ltoff(@tprel(" #x ")),gp\n\t" \ ";;\n\t" \ "ld8 r17=[r16]\n\t" \ ";;\n\t" \ "add %0=r13,r17\n\t" \ - : "=r" (__l) : : "r16", "r17" ); __l; }) + : "=r" (__l) : "r" (__gp) : "r16", "r17" ); __l; }) # define __TLS_CALL_CLOBBERS \ "r2", "r3", "r8", "r9", "r10", "r11", "r14", "r15", "r16", "r17", \ @@ -335,6 +336,7 @@ register void *__gp __asm__("$29"); # define TLS_LD(x) \ ({ void *__l; \ + register long __gp asm ("gp"); \ asm (";;\n\t" \ "mov loc0=gp\n\t" \ "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \ @@ -345,11 +347,12 @@ register void *__gp __asm__("$29"); ";;\n\t" \ "mov gp=loc0\n\t" \ "mov %0=r8\n\t" \ - : "=r" (__l) : : "loc0", __TLS_CALL_CLOBBERS); \ + : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \ __l; }) # define TLS_GD(x) \ ({ void *__l; \ + register long __gp asm ("gp"); \ asm (";;\n\t" \ "mov loc0=gp\n\t" \ "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \ @@ -361,7 +364,7 @@ register void *__gp __asm__("$29"); ";;\n\t" \ "mov gp=loc0\n\t" \ "mov %0=r8\n\t" \ - : "=r" (__l) : : "loc0", __TLS_CALL_CLOBBERS); \ + : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \ __l; }) #elif defined __sparc__ && !defined __arch64__ Jakub