avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] 'relocation truncated to fit' diagnosis ideas?


From: Jan Waclawek
Subject: Re: [avr-gcc-list] 'relocation truncated to fit' diagnosis ideas?
Date: Thu, 3 May 2012 08:28:57 +0200

As the first step, I'd recommend you to use a proven toolchain, like 
WinAVR20100110. I don't say it does not have issues but at least it's not a 
moving target. The notable two issues I am aware of are a library issue where 
rjmp/rcall between functions fall too far apart, and a linker bug related to 
-relax. Both can be fixed in your sources, IMO, and there's no reason to move 
to toolchains with potentially other yet unknown problems. If you'd insist on 
that, I'd recommend you to pick Georg-Johann's build from 
http://sourceforge.net/projects/mobilechessboar/files/avr-gcc%20snapshots%20%28Win32%29/
 , discussed in 
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=115337 .

You should consider posting a minimal compilable example exhibiting the 
problem, together with the command line switches etc. IMHO a better place to do 
that is the avr-gcc section of avrfreaks' forum, rather than this list.

JW

----- Original Message ---------------
>Received this error tonight after enabling a new chunk of code to 
>compile on a MEGA168 target
>
>I noticed some fixes in newer AVR GCC versions for things like this, so 
>I pulled GCC 4.7.0:
>
>http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=117504&postdays=0&postorder=asc
>
>I got further, but after copying back in all the code I had pulled out, 
>it still complains about R_AVR_13_PCREL errors.
>
>-lm and relax have been on all the time.
>
>Is there a tutorial that describes how to restructure your code or your 
>Makefile to overcome this issue?  I understand it's a RJMP 13 bit 
>address overrun issue during linking, but I am lost on how to address 
>the issue.  Essentially the same code compiles fine for MEGA162, and the 
>current codebase compiles fine if I leave off a few calls in main.c.
>
>My code is GPL, available to anyone who is keen to see it fail themselves.
>
>Jim
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]