This is the mail archive of the gcc-bugs@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/3925: [ARM/Thumb] Assembler chokes on branches with (PLT)


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.


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