target/3925: [ARM/Thumb] Assembler chokes on branches with (PLT)

Richard Earnshaw rearnsha@arm.com
Tue Mar 19 03:16:00 GMT 2002


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

From: Richard Earnshaw <rearnsha@arm.com>
To: gcc-gnats@gcc.gnu.org, pb@gcc.gnu.org, fnf@ninemoons.com,
        gcc-bugs@gcc.gnu.org, rearnsha@gcc.gnu.org
Cc:  
Subject: Re: target/3925: [ARM/Thumb] Assembler chokes on branches with (PLT)
Date: Tue, 19 Mar 2002 11:09:28 +0000

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3925
 
 I'm still not convinced by the need for (PLT) annotations at all.  The
 arguments that led to their creation don't seem to be correct, as far as
 I can tell.
 
 My understanding is as follows:
 
 1) The linker needs to do something different to a BL instruction when
 producing a shared library.
 2) In order to do this, the relocation type must be different.
 
 However, I strongly believe that 2 is false.  The reasons are as
 follows.
 
 1) When building a shared library, whatever we do to a PLT32 type
 relocation we must also do to a arm24 type relocation, since we have to
 be able to support non-pic code in a shared library.
 2) When not building a shared library, whatever we do to a arm24 type
 relocation we must also do to a PLT32 relocation.
 
 It therefore follows that the two are really the same, and the
 justification for their separate existence is incorrect.
 
 Even if it could be shown that the two relocation types must be
 different, then there is no reason for annotating the label in this
 way.  When assembling PIC code all BL type instructions should generate
 a PLT32 relocation (assuming any relocation is required at all) and when
 not generating PIC code all BL type instructions should generate an
 arm24 relocation.  Hence it is possible to determine the relocation type
 required simply by the presence of the -k flag on the assembler command
 line: no annotation of the labels is required.
 
 R.



More information about the Gcc-prs mailing list