Jim Brain schrieb:
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.
It's not about -lm "on" or "off", it must be at the right position in
the linker command line to have the desired effect.
Besides that we don't see the error message and there is o clue if the
problem comes from library code from libgcc, from AVR-LibC, other lib,
home-brew assembler-code or gcc-generated assembler code.
The mentioned error might also be caused by AVR-LibC issue
http://savannah.nongnu.org/bugs/?33698
FYI, there are also some binutils issues, amongst them
http://sourceware.org/PR13899 so if you use binutils built from
trunk you may want to disable relaxing.
Notice that you don't need to use binutils shipped with a particular
distribution or snapshot; you can just as well use binutils from some
different package. But be aware that the older it is, the more features
might be missing; e.g. plugin support needed from LTO.
From what I can tell avr-binutils 2.21 works fine.
However, your issue is not a binutils issue except of the rare case of
http://sourceware.org/PR13410
Or it is a new problem never reported before.
Johann
My code is GPL, available to anyone who is keen to see it fail themselves.
Jim
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list