This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: relocation questions
guilherme antoniolo <antoniolo@gmail.com> writes:
> Curiously, when inspecting the whole build process, I found out that
> linker patches the near call to a near jump instruction, then through
> a table (I suppose) it performs another jump, a far one. In other
> words, two jumps.
>
> 1) why performing two jumps over a far call?
Most likely because the linker is unable to change the size of the
instruction. Changing the size of an instruction in the linker means
that the linker must be able to change every other instruction which
would be affected.
> I also read in docs that there is an implementation -mlong-calls
> available for ARM. If I understood it correctly, that would be exactly
> what I'm looking for.
>
> 2) Is there a way to induce gcc for doing something similar to me? I
> tried unsuccessfully to do it through inline asm.
Do you mean, is there any way other than using -mlong-calls? You
implied that you were using ARM but you didn't really say. What
target are you using?
Ian