From patchwork Wed Jan 19 14:37:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Millan X-Patchwork-Id: 79474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EFFD9B70CC for ; Thu, 20 Jan 2011 01:37:43 +1100 (EST) Received: (qmail 31727 invoked by alias); 19 Jan 2011 14:37:41 -0000 Received: (qmail 31716 invoked by uid 22791); 19 Jan 2011 14:37:40 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Jan 2011 14:37:35 +0000 Received: by iwn8 with SMTP id 8so875969iwn.20 for ; Wed, 19 Jan 2011 06:37:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.10.197 with SMTP id q5mr878399ibq.197.1295447848216; Wed, 19 Jan 2011 06:37:28 -0800 (PST) Received: by 10.231.5.153 with HTTP; Wed, 19 Jan 2011 06:37:28 -0800 (PST) Date: Wed, 19 Jan 2011 15:37:28 +0100 Message-ID: Subject: [PATCH #2] stop using linux-unwind.h on GNU targets with kernels other than Linux From: Robert Millan To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2011/1/14 Robert Millan : > Confirmed, linux-unwind.h can be removed. > 2011/1/12 Joseph S. Myers : >> If disabled for non-Linux-kernel targets, the >> REG_NAME abstraction may as well be removed as not actually being useful >> at present. > > Ack.  I'll send a patch for this. Here is it, relative to my AMD64 patch. ChangeLog in patch header. 2011-01-19 Robert Millan * config/i386/linux.h (REG_NAME): Remove. * config/i386/linux64.h: Likewise. * config/i386/kfreebsd-gnu.h: Likewise. * config/i386/knetbsd-gnu.h: Likewise. * config/i386/linux-unwind.h (x86_fallback_frame_state): Remove all use of REG_NAME (on GNU/Linux it's a no-op). * config/i386/kfreebsd-gnu.h (MD_UNWIND_SUPPORT): Undefine. * config/i386/knetbsd-gnu.h: Likewise. === modified file 'gcc/config/i386/kfreebsd-gnu.h' --- gcc/config/i386/kfreebsd-gnu.h 2011-01-18 22:00:14 +0000 +++ gcc/config/i386/kfreebsd-gnu.h 2011-01-18 22:34:17 +0000 @@ -29,5 +29,4 @@ along with GCC; see the file COPYING3. #define GLIBC_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1" #endif -#undef REG_NAME -#define REG_NAME(reg) sc_ ## reg +#undef MD_UNWIND_SUPPORT === modified file 'gcc/config/i386/knetbsd-gnu.h' --- gcc/config/i386/knetbsd-gnu.h 2011-01-18 22:00:14 +0000 +++ gcc/config/i386/knetbsd-gnu.h 2011-01-18 22:34:36 +0000 @@ -19,5 +19,4 @@ You should have received a copy of the G along with GCC; see the file COPYING3. If not see . */ -#undef REG_NAME -#define REG_NAME(reg) sc_ ## reg +#undef MD_UNWIND_SUPPORT === modified file 'gcc/config/i386/linux-unwind.h' --- gcc/config/i386/linux-unwind.h 2011-01-18 22:00:14 +0000 +++ gcc/config/i386/linux-unwind.h 2011-01-19 14:27:25 +0000 @@ -146,28 +146,28 @@ x86_fallback_frame_state (struct _Unwind else return _URC_END_OF_STACK; - new_cfa = sc->REG_NAME(esp); + new_cfa = sc->esp; fs->regs.cfa_how = CFA_REG_OFFSET; fs->regs.cfa_reg = 4; fs->regs.cfa_offset = new_cfa - (long) context->cfa; /* The SVR4 register numbering macros aren't usable in libgcc. */ fs->regs.reg[0].how = REG_SAVED_OFFSET; - fs->regs.reg[0].loc.offset = (long)&sc->REG_NAME(eax) - new_cfa; + fs->regs.reg[0].loc.offset = (long)&sc->eax - new_cfa; fs->regs.reg[3].how = REG_SAVED_OFFSET; - fs->regs.reg[3].loc.offset = (long)&sc->REG_NAME(ebx) - new_cfa; + fs->regs.reg[3].loc.offset = (long)&sc->ebx - new_cfa; fs->regs.reg[1].how = REG_SAVED_OFFSET; - fs->regs.reg[1].loc.offset = (long)&sc->REG_NAME(ecx) - new_cfa; + fs->regs.reg[1].loc.offset = (long)&sc->ecx - new_cfa; fs->regs.reg[2].how = REG_SAVED_OFFSET; - fs->regs.reg[2].loc.offset = (long)&sc->REG_NAME(edx) - new_cfa; + fs->regs.reg[2].loc.offset = (long)&sc->edx - new_cfa; fs->regs.reg[6].how = REG_SAVED_OFFSET; - fs->regs.reg[6].loc.offset = (long)&sc->REG_NAME(esi) - new_cfa; + fs->regs.reg[6].loc.offset = (long)&sc->esi - new_cfa; fs->regs.reg[7].how = REG_SAVED_OFFSET; - fs->regs.reg[7].loc.offset = (long)&sc->REG_NAME(edi) - new_cfa; + fs->regs.reg[7].loc.offset = (long)&sc->edi - new_cfa; fs->regs.reg[5].how = REG_SAVED_OFFSET; - fs->regs.reg[5].loc.offset = (long)&sc->REG_NAME(ebp) - new_cfa; + fs->regs.reg[5].loc.offset = (long)&sc->ebp - new_cfa; fs->regs.reg[8].how = REG_SAVED_OFFSET; - fs->regs.reg[8].loc.offset = (long)&sc->REG_NAME(eip) - new_cfa; + fs->regs.reg[8].loc.offset = (long)&sc->eip - new_cfa; fs->retaddr_column = 8; fs->signal_frame = 1; return _URC_NO_REASON; === modified file 'gcc/config/i386/linux.h' --- gcc/config/i386/linux.h 2011-01-18 22:00:14 +0000 +++ gcc/config/i386/linux.h 2011-01-18 22:20:49 +0000 @@ -202,9 +202,6 @@ along with GCC; see the file COPYING3. /* Static stack checking is supported by means of probes. */ #define STACK_CHECK_STATIC_BUILTIN 1 -/* This macro may be overridden in i386/k*bsd-gnu.h. */ -#define REG_NAME(reg) reg - #ifdef TARGET_LIBC_PROVIDES_SSP /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ #define TARGET_THREAD_SSP_OFFSET 0x14 === modified file 'gcc/config/i386/linux64.h' --- gcc/config/i386/linux64.h 2011-01-18 22:00:14 +0000 +++ gcc/config/i386/linux64.h 2011-01-18 22:19:19 +0000 @@ -116,9 +116,6 @@ see the files COPYING3 and COPYING.RUNTI /* Static stack checking is supported by means of probes. */ #define STACK_CHECK_STATIC_BUILTIN 1 -/* This macro may be overridden in i386/k*bsd-gnu.h. */ -#define REG_NAME(reg) reg - #ifdef TARGET_LIBC_PROVIDES_SSP /* i386 glibc provides __stack_chk_guard in %gs:0x14, x86_64 glibc provides it in %fs:0x28. */