I have two output sections (highcode and lowcode). I can call functions in highcode from lowcode, but not the other way. It seems that the _call_via_rX stubs are all in the lowcode section, and code in highcode cannot branch to the stub. see make.sh for options used (assembler, compiler and linker) highcode.o: In function `DoStuffInHiArea(int)': highcode.o(.highcode+0x12): relocation truncated to fit: R_ARM_THM_PC22 _call_via_r3 Release: 3.0.4 (with long calls patch) Environment: running on Redhat linux 7.3, building for embedded ARM7TDMI How-To-Repeat: Sorry it has to be multiple files (they are a single directory - extract to anywhere) run ./make.sh, it will compile and try to link
Fix: none I can find
Hello gcc 3.0.4 is rather old at this point. Would it be possible for you to check whether this problem still occurs with gcc 3.3? Thanks, Dara
See Dara's Question
Subject: Re: [ARM/Thumb] long calls stubs only in one code section, cannot branch to them from other section dhazeghi@yahoo.com wrote: > > ------- Additional Comments From dhazeghi@yahoo.com 2003-05-26 04:10 ------- > Hello > > gcc 3.0.4 is rather old at this point. Would it be possible for you to > check whether this problem still occurs with gcc 3.3? Thanks, > > Dara > I can't easily check 3.3 until a colleague returns from holiday. I'll get him to try it as soon as he gets back. However, in the meantime, I can confirm that 3.2 had the problem. Andy
Andy, just a reminder that this bug is awaiting feedback... Dara
I know this hasn't been fixed yet. No need for further confirmation.
Subject: Re: [ARM/Thumb] long calls stubs only in one code section, cannot branch to them from other section rearnsha at gcc dot gnu dot org wrote: > PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7525 > > > rearnsha at gcc dot gnu dot org changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |rearnsha@arm.com > Status|NEW |SUSPENDED > > > ------- Additional Comments From rearnsha at gcc dot gnu dot org 2003-06-18 16:07 ------- > I know this hasn't been fixed yet. No need for further confirmation. > Thanks - we're actually having some trouble building version 3.3 right now, let alone testing the problem! Andy
Whoops! Did not intend to suspend this
Bug still exists in 3.3.1, in case anybody cares.
In the general case of calling library support functions, this really needs fixing in the linker. I'm going to fix this for the specific case of __call_via_<rn> because this is necessary to generate code that conforms to the EABI (__call_via_<rn> isn't a recognized library entry point).
Subject: Bug 7525 CVSROOT: /cvs/gcc Module name: gcc Changes by: rearnsha@gcc.gnu.org 2005-01-14 13:58:42 Modified files: gcc : ChangeLog gcc/config/arm : arm-protos.h arm.c arm.h arm.md Log message: PR target/7525 * arm.h (struct machine_function): Add call_via field. (thumb_call_via_label): Declare. * arm.c (thumb_call_via_label): New variable. (thumb_call_reg_needed): New variable. (arm_output_function_epilogue): For Thumb code, output any per-function call-indirect trampolines. (thumb_call_via_reg): New function. (arm_file_end): New function. (TARGET_ASM_FILE_END): Call arm_file_end. (aof_file_end): Likewise. * arm-protos.h (thumb_call_via_reg): Declare. * arm.md (call_reg_thumb, call_value_reg_thumb): Call thumb_call_via_reg in normal case. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7120&r2=2.7121 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm-protos.h.diff?cvsroot=gcc&r1=1.79&r2=1.80 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.c.diff?cvsroot=gcc&r1=1.426&r2=1.427 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.h.diff?cvsroot=gcc&r1=1.264&r2=1.265 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.md.diff?cvsroot=gcc&r1=1.188&r2=1.189
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00813.html Fixed for the common case, but not for caller super-inteworking. I don't intend to change that case, since that's outside the EABI and I still think the linker should be fixing these types of problems up with linker-generated stubs.
Subject: Bug 7525 CVSROOT: /cvs/gcc Module name: gcc Branch: csl-arm-branch Changes by: mmitchel@gcc.gnu.org 2005-03-22 20:19:20 Modified files: gcc : ChangeLog.csl-arm gcc/config/arm : arm-protos.h arm.c arm.h arm.md Log message: Merge from mainline. 2005-01-14 Richard Earnshaw <rearnsha@arm.com> PR target/7525 * arm.h (struct machine_function): Add call_via field. (thumb_call_via_label): Declare. * arm.c (thumb_call_via_label): New variable. (thumb_call_reg_needed): New variable. (arm_output_function_epilogue): For Thumb code, output any per-function call-indirect trampolines. (thumb_call_via_reg): New function. (arm_file_end): New function. (TARGET_ASM_FILE_END): Call arm_file_end. (aof_file_end): Likewise. * arm-protos.h (thumb_call_via_reg): Declare. * arm.md (call_reg_thumb, call_value_reg_thumb): Call thumb_call_via_reg in normal case. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.csl-arm.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.1.2.95&r2=1.1.2.96 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm-protos.h.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.60.4.17&r2=1.60.4.18 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.c.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.303.2.72&r2=1.303.2.73 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.h.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.210.2.55&r2=1.210.2.56 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.md.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.145.2.29&r2=1.145.2.30