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]
Other format: [Raw text]

Re: powerpc-eabi subroutine calls


Hi,

to make gcc generate a "far" subroutine call, an attribute must be added
to the function declaration:

     void foo (int bar1, char bar2) __attribute__ ((longcall));

This has to be done for any function which might be called from a location
more than 8MB away.

The generated assembler code looks like this:

    lis 9,foo@ha
    la 0,foo@l(9)
    mtlr 0
    li 4,0                 # 2nd argument
    li 3,100               # 1st argument
    blrl


BTW, this is clearly documented in "Using and Porting the GNU Compiler 
Collection", chap. 4.23 "Declaring Atttibutes of Functions".

Thanks to Franz Fischer, who pointed that out to me in a private mail.

gm
-- 
Gunter Magin                                         magin[AT]skil.camelot.de

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


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