This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix profiling for PIC Thumb code
- From: Daniel Jacobowitz <drow at false dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Mar 2005 10:32:13 -0500
- Subject: Fix profiling for PIC Thumb code
Gas accepts (and does very little with, nowadays) the "(PLT)" suffix for
ARM. However, it doesn't accept it for Thumb. All the uses of
NEED_PLT_RELOC are already guarded by TARGET_ARM except for this one.
OK for HEAD and csl-arm-branch? Not sure about 4.0 - definitely it is not a
regression.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-03-02 Daniel Jacobowitz <dan@codesourcery.com>
* config/arm/linux-elf.h (ARM_FUNCTION_PROFILER): Do not use (PLT)
for Thumb.
* config/arm/netbsd-elf.h (ARM_FUNCTION_PROFILER): Likewise.
Index: config/arm/linux-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/linux-elf.h,v
retrieving revision 1.41.4.7
diff -u -p -r1.41.4.7 linux-elf.h
--- config/arm/linux-elf.h 20 Nov 2004 02:18:40 -0000 1.41.4.7
+++ config/arm/linux-elf.h 2 Mar 2005 15:29:19 -0000
@@ -1,5 +1,6 @@
/* Definitions for ARM running Linux-based GNU systems using ELF
- Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005
Free Software Foundation, Inc.
Contributed by Philip Blundell <philb@gnu.org>
@@ -117,7 +118,8 @@
#undef ARM_FUNCTION_PROFILER
#define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
{ \
- fprintf (STREAM, "\tbl\tmcount%s\n", NEED_PLT_RELOC ? "(PLT)" : ""); \
+ fprintf (STREAM, "\tbl\tmcount%s\n", \
+ (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : ""); \
}
/* The linux profiler clobbers the link register. Make sure the
Index: config/arm/netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/netbsd-elf.h,v
retrieving revision 1.5.10.5
diff -u -p -r1.5.10.5 netbsd-elf.h
--- config/arm/netbsd-elf.h 18 Nov 2004 15:57:35 -0000 1.5.10.5
+++ config/arm/netbsd-elf.h 2 Mar 2005 15:29:19 -0000
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This file is part of GCC.
@@ -97,7 +97,8 @@
{ \
asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n"); \
asm_fprintf (STREAM, "\tbl\t__mcount%s\n", \
- NEED_PLT_RELOC ? "(PLT)" : ""); \
+ (TARGET_ARM && NEED_PLT_RELOC) \
+ ? "(PLT)" : ""); \
}
/* VERY BIG NOTE: Change of structure alignment for NetBSD/arm.