From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26277 invoked by alias); 19 Mar 2002 15:26:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 26233 invoked by uid 71); 19 Mar 2002 15:26:03 -0000 Date: Tue, 19 Mar 2002 07:26:00 -0000 Message-ID: <20020319152603.26224.qmail@sources.redhat.com> To: pb@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Philip Blundell Subject: Re: target/3925: [ARM/Thumb] Assembler chokes on branches with (PLT) Reply-To: Philip Blundell X-SW-Source: 2002-03/txt/msg00719.txt.bz2 List-Id: The following reply was made to PR target/3925; it has been noted by GNATS. From: Philip Blundell To: Richard.Earnshaw@arm.com Cc: gcc-gnats@gcc.gnu.org, pb@gcc.gnu.org, fnf@ninemoons.com, gcc-bugs@gcc.gnu.org, rearnsha@gcc.gnu.org Subject: Re: target/3925: [ARM/Thumb] Assembler chokes on branches with (PLT) Date: 19 Mar 2002 15:19:53 +0000 On Tue, 2002-03-19 at 15:09, Richard Earnshaw wrote: > But for branches, my point still stands, the model to use for both types > of reloc is the same; and what's more, both cases would benefit from the > use of such a model Yeah, I was only talking about branches. My point was that there are cases where people want to build a "shared object" (in the sense of "gcc -shared") but don't ever intend to have more than one copy of it resident in memory at once. In that situation, having relocations in the text section is sometimes acceptable for the sake of saving the time and space that is required for the PLT. At the moment, you can get exactly that effect by compiling without -fPIC and linking with "gcc -shared". If -shared was made to imply function calls via PLT, that would no longer be possible. > (in one case it makes the code work when it wouldn't > have done otherwise, and in the second it makes the code more efficient by > eliminating the PLT stub when it isn't needed). It's only an efficiency issue rather than a correctness one in both cases. If you build a shared library with PC24 relocs, the dynamic linker will just modify your text segment in place - the pages will be dirtied, but your program will still work. If the offset doesn't fit in 24 bits, the dynamic linker will synthesize a PLT equivalent for you at run time. (In theory, there are situations where the latter wouldn't be possible, but in practice I haven't heard of anyone having problems.) p.