This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: 32 bit relative branch instructions


> > Gcc for arm generates 24 bit branch instructions  I wonder if there's a
> > flag ( or maybe a patch exists) that would allow me to tell it to generate
> > 32 bit relative branch instructions.
>
> Eh?  The ARM doesn't have a 32-bit branch instruction.  
> The "-mlong-calls" option in the GCC trunk and 3.0 branch (though not 2.95.x) 
> might do what you want, though.

We solved that one by making a "bx_to" function.  Just...

bx_to:
	bx r0

Then for any function that's located in the far region of address space,
you can call it as

	rv = bx_to(function_ptr, arg1, arg2, arg3);

Note that each function you call this way has to have a throw-away first
parameter which will always be equal to the address of the function being
called, but that's no biggie.


-------------------------------------------
Carl Miller               Firmware Engineer
chaz@gordian.com              Gordian, Inc.
(714) 850-0205       http://www.gordian.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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