target/3925: [ARM/Thumb] Assembler chokes on branches with (PLT)
Philip Blundell
pb@nexus.co.uk
Tue Mar 19 07:26:00 GMT 2002
The following reply was made to PR target/3925; it has been noted by GNATS.
From: Philip Blundell <pb@nexus.co.uk>
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.
More information about the Gcc-prs
mailing list