>       Why can the linker not deal with function calls more then a 26 bit
>address offset from teh PC? 

The B instruction only has a 24-bit displacement field.  That stores a number
of words which gives you a 26-bit address offset.  To do jumps beyond that, 
the linker would have to bounce the call through a PLT entry.  It probably 
wouldn't be too hard to make this happen automatically for out of range 
jumps if you wanted (though this should be controlled by a switch).  As a 
matter of passing interest modutils already does something a bit like this 
so that kernel modules can be quite distant from the main code body.

Another possibility would be to extend the compiler and/or assembler to let 
you declare a particular function call as being "long" and have that generate 
code that rather than a straightforward branch contained code a bit like this:

        mov     lr, pc
        ldr     pc, =target

It would take quite a lot to convince me that the latter was worth including 
in GCC, though.  The linker thing seems conceptually cleaner - there will be 
a performance hit but I doubt it is measurable.

In theory a smart linker could actually perform the second trick too but GNU 
ld isn't currently up to it.

(Why do you want to do this in the first place, by the way?)

p.


unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to