This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"relocation truncated to fit" problem


Hi, all

I am working on a processor with very limited local storage. I am trying
to run a program bigger than local storage in the processor, using the
similiar mechanism to overlaying. Currently, I cannot even compile the big
program, due to "relocation truncated to fit" errors.

I understand the problem, but I am not sure how to solve it. If a
branch target offset is too large for an architecture, the branch has to
be transformed to an indirect one. The problem is among compiler, assembler
and linker, who should take care of the problem? Does the compiler have to be
aware of the exact offset of the branch? It may be possible if the target
is inside the same compilation unit, but for external definitions
(relocations in the object files), compiler surely doesn't have an idea,
so how can it make a right decision on using relative branch or indirect
branch?? Should this problem be taken care by the linker? Then what kind
of branch compiler should generate first? Can the linker transform a relative
branch to an indirect one? I am quite confused about how the toolchain
works together and make this working. Could somebody explain it to me?

I am using a port of GNU toolchain. Anybody knows a work around?

Thanks so much!!

Tao
			-Tao Zhang (zhangtao@cc.gatech.edu)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]