ARM/THUMB long calls stubs

Nick Clifton nickc@redhat.com
Mon Aug 9 12:20:00 GMT 2004


Hi Sami, Hi Richard,

>>>Would it be hard to fix this? So that gcc would take __attribute__
>>>((section())) in account when determining if functions are in different
>>>sections or not. Feels bad as all functions are called with the long call..

I think that this is a real bug in gcc.

The problem appears to be that the short-call attribute is being set for 
any function that has already been compiled in a compilation unit, 
regardless of whether that function has a section attribute or not.  In 
effect this is saying that the compiler thinks that any function it has 
already compiled must be within a short-call range of any function that 
it is about to compile.

The attached patch removes this assumption and tidies up some of the 
comments in the code associated with the arm_is_longcall_p().  I have 
tested it with an arm-elf build and found no regressions, so unless 
Richard has any objections I plan to check it in later this week.

Cheers
   Nick

gcc/ChangeLog
2004-08-09  Nick Clifton  <nickc@redhat.com>

	* config/arm/arm.c (arm_is_longcall_p): When -mlong-call is in
	effect allow long calling when either the current or target
	function has the section attribute or -ffunction-sections is in
	effect.
	* config/arm/arm.h (ARM_DECLARE_FUNCTION_SIZE): Do not set the
	short-call attribute when the function has the section attribute
	and -mlong-call is in effect.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: arm.longcall.patch
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20040809/ce7b2d7c/attachment.ksh>


More information about the Gcc-bugs mailing list