bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/13410] New: [avr]: error: relocation truncated to fit: R_AVR_13_


From: gjl at gcc dot gnu.org
Subject: [Bug ld/13410] New: [avr]: error: relocation truncated to fit: R_AVR_13_PCREL against symbol
Date: Mon, 14 Nov 2011 22:29:02 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13410

             Bug #: 13410
           Summary: [avr]: error: relocation truncated to fit:
                    R_AVR_13_PCREL against symbol
           Product: binutils
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
    Classification: Unclassified
            Target: avr


== Affected versions ==

At least 2.20 and 2.21

== source (foo.ss) ==

.text
.global main
.global sin

main:    ret

.section    .progmem.data,"a",@progbits

aaa:    .zero    3848


== Steps to reproduce ==

You need an avr-toolchain installation, i.e. avr-gcc, avr-binutils and
avr-libc. I couln'd reproduce the error without linking against avr-libc

$ avr-as foo.ss -o foo.o -mmcu=atmega2560

$ avr-gcc -Wl,--cref -mrelax -Wl,-relax foo.o -mmcu=atmega2560 -o foo.elf
-Wl,-Map=foo.map -lm

The bug depends on how big the functions in avr-libc are. If you do not see the
bug (which is likely) do the following: Generate a list file:

$ avr-objdump -d foo.elf > foo.lst

The end list file will look like

...
0000133e <__stop_program>:
    133e: ff cf       rjmp .-2    ; 0x133e <__stop_program>

Adjust the size of aaa from foo.ss to that __stop_program will be located at
address 0x133c.  In the example, you would have to decrease the size of aaa by
2.


== Full output from linker with -v -Wl,-v ==

> "make" XXX

avr-gcc  -Wl,--cref -mrelax -Wl,-relax foo.o -mmcu=atmega2560 -o foo.elf
-Wl,-Map=foo.map -lm -v -Wl,-v

Using built-in specs.
COLLECT_GCC=e:/WinAVR/4.5.2/bin/avr-gcc
COLLECT_LTO_WRAPPER=e:/winavr/4.5.2/bin/../libexec/gcc/avr/4.5.2/lto-wrapper.exe
Target: avr
Configured with: ../gcc-4.5.2/configure --prefix=c:/mhvavrtools
--host=i686-pc-mingw32 --target=avr --enable-languages=c,c++ --with-dwarf2
-enable-win32-registry=MHV-AVR-Tools --disable-nls --with-gmp=c:/mhvavrtools
--with-mpfr=c:/mhvavrtools --with-mpc=c:/mhvavrtools --disable-libssp
Thread model: single
gcc version 4.5.2 (GCC) 
COMPILER_PATH=e:/winavr/4.5.2/bin/../libexec/gcc/avr/4.5.2/;e:/winavr/4.5.2/bin/../libexec/gcc/;e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/bin/
LIBRARY_PATH=e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/avr6/;e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib/avr6/;e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/;e:/winavr/4.5.2/bin/../lib/gcc/;e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib/
COLLECT_GCC_OPTIONS='-mrelax' '-mmcu=atmega2560' '-o' 'foo.elf' '-v'
 e:/winavr/4.5.2/bin/../libexec/gcc/avr/4.5.2/collect2.exe --relax -m avr6
-Tdata 0x800200 -o foo.elf
e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib/avr6/crtm2561.o
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/avr6
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib/avr6
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2 -Le:/winavr/4.5.2/bin/../lib/gcc
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib --cref -relax
foo.o -Map=foo.map -lm -v -lgcc -lc -lgcc
collect2 version 4.5.2 (GNU assembler syntax)
e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/bin/ld.exe --relax -m
avr6 -Tdata 0x800200 -o foo.elf
e:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib/avr6/crtm2561.o
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/avr6
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib/avr6
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2 -Le:/winavr/4.5.2/bin/../lib/gcc
-Le:/winavr/4.5.2/bin/../lib/gcc/avr/4.5.2/../../../../avr/lib --cref -relax
foo.o -Map=foo.map -lm -v -lgcc -lc -lgcc
GNU ld (GNU Binutils) 2.20.1.20100303

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

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