This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC 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]

Re: target/5399: arm/thumb: pointer indirections when using -fpic


The following reply was made to PR target/5399; it has been noted by GNATS.

From: Phil Blundell <pb@nexus.co.uk>
To: Adrian von Bidder <avbidder@atlas.acter.ch>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: target/5399: arm/thumb: pointer indirections when using -fpic
Date: 16 Jan 2002 11:11:54 +0000

 On Wed, 2002-01-16 at 10:22, Adrian von Bidder wrote:
 > The problem is - afaics - the GOTOFF (instead of GOT). In the linked binary,
 > .L2 contains the offset of .LC1 from start of GOT, which is start of data, too,
 > and not the offset of a GOT entry for .LC1. So the first load loads .L2, the
 > second load already loads the string pointer .LC1 and the third load then loads
 > the first four bytes of the string itself...
 
 Try something like this.  The problem isn't so much the GOTOFF itself
 (although the handling of that is fairly broken) as that the indirection
 through .LC1 shouldn't be happening in the first place.
 
 p.
 
 Index: arm.h
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
 retrieving revision 1.98.4.3
 diff -u -r1.98.4.3 arm.h
 --- arm.h	2001/12/07 09:49:23	1.98.4.3
 +++ arm.h	2002/01/16 11:08:13
 @@ -1899,7 +1899,8 @@
  #define THUMB_LEGITIMATE_CONSTANT_P(X)	\
   (   GET_CODE (X) == CONST_INT		\
    || GET_CODE (X) == CONST_DOUBLE	\
 -  || CONSTANT_ADDRESS_P (X))
 +  || CONSTANT_ADDRESS_P (X)		\
 +  || flag_pic)
  
  #define LEGITIMATE_CONSTANT_P(X)	\
    (TARGET_ARM ? ARM_LEGITIMATE_CONSTANT_P (X) : THUMB_LEGITIMATE_CONSTANT_P (X))
 


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