a question about pc-relative branch and function call

Eric Christopher echristo@apple.com
Tue Feb 14 05:21:00 GMT 2006


On Feb 13, 2006, at 8:31 PM, Eric Fisher wrote:

> Thanks. I'm working to port gcc to our chip. I use mips-elf as the  
> start. Yet,
> we don't have pc-region branch instructions such as 'j target'. So I'm
> confused how to solve the function call translation. Thanks again.

If you don't have a jump to the full 4 gig address space take a look  
at the ppc port.
It's probably best to use a branch stub in the linker (as is done in  
binutils) instead of
the gcc work in the ppc backend, but that'll give you a place to start.

Ideally you'll just emit "branch foo" to get to a label and then have  
the linker fix up
anything else.

Best of luck.

-eric



More information about the Gcc mailing list