This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ARM thumbmode architecture question
- From: Ian Lance Taylor <iant at google dot com>
- To: Steffen Dettmer <steffen dot dettmer at googlemail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 15 Mar 2011 06:29:58 -0700
- Subject: Re: ARM thumbmode architecture question
- References: <AANLkTik5jbHqOSWiw8U+ZbL7y4TUSbR-TOZiU3TTu_yj@mail.gmail.com>
Steffen Dettmer <steffen.dettmer@googlemail.com> writes:
> The application size increased, exeeded 4 MB (working) and
> finally around 4 MB and I ended up with the linker error
> "relocation truncated to fit: R_ARM_THM_PC22":
>
> relocation truncated to fit: R_ARM_THM_PC22
> against symbol `_call_via_r4' defined in .text section in
> /tmp/x/lib_gcc_gnu/libgcc.a(_call_via_rX.o)
> ../../../../../myfile.c:238: relocation truncated to fit: R_ARM_THM_PC22
> against symbol `_call_via_r3' defined in .text section in
> /tmp/x/lib_gcc_gnu/libgcc.a(_call_via_rX.o)
> [more similar errors, depending on my #defines/my code various
> symbols from various source files]
I note that this is in libgcc.a, which will not be affected by using
-mlong-calls to compile your application.
> I searched the internet and read about `trampolines' and the
> general possibility to have small wrapper functions in ARM code
> able to execute very long calls (gigabyte range).
> Compilers/linkers could theoretically automatically use such
> "wrappers". This information is in contrast to the previous one.
The linker does have support for this. Which version of the linker are
you using?
Ian