Why “relocation truncated to fit”?

Florian Weimer fw@deneb.enyo.de
Mon Oct 3 12:57:00 GMT 2016


* Joel Sherrill:

> When we see this linking RTEMS applications, it is just one if a
> handful of odd messages that equate to "the program doesn't fit in
> memory". Generally some section has too much in it.
>
> Details usually don't matter if it is a test. We mark it as a fail to
> link and continue. If it is a real application, then someone has work
> to do to find and trim some fat in their code. :)
>
> Is there any other response from a user?

The usual response (at least in the non-embedded space in which
distribution porters work in) is to use different relocations, e.g.,
when compiling with GCC, -fPIC instead of -pfic, or adding -mxgot in
case of MIPS.



More information about the Binutils mailing list