bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARM/Thumb long calls stubs


From: OMakarenko
Subject: Re: ARM/Thumb long calls stubs
Date: Tue, 30 Apr 2002 12:54:54 +0400

> > The following examples doesn't work with 2.12 binutils:
> > 
> > Thumb_func1 (void) { }
> > 
> > Thumb_func2 (void) { Thumb_func1 (); }
> > 
> > if the distance between func1 and func2 is happen to be more then 4M
> > this code fails.
> 
> Try compiling the code with the -mlong-calls.  This switch tells the
> compiler to expect these kind of very long function calls and to use
> an alternative, (and less efficient) method of function calling.
> 
        Yes, I know.

        GCC 3.0.4 has its own bugs in long-calls (currently it crashes on my
project if try to use this option).

        But how can I know in advance what functions should be made
"long-calls"? I don't want compiler to use BX instead of BL everywhere.

        And for the second example:
        ARM_func(void) {
                
        }

        Thumb_func (void) {
                ARM_func();
        }

        With -mlong-calls I can not control what code compiler uses to call
thumb to arm _stub_.

        LD generates only one stub for ARM_func. That only stub may be not
accessable from some parts of thumb code. 

        So how can this be done without linker support?

        It would be nice for the linker to add long-calls stubs instead. Is
that possible?

> > Or it should report an error at least.
> 
> If the linker is not reporting an error when it attempts to resolve
> a BL instruction whoes target is too far away then yes, this is a bug.
> 
        It doesn't. It generates wrong offsets instead and hence broken
code.

        =oleg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]