[Top][All Lists]

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

[Bug ld/13899] [avr]: Wrong relaxation of R_AVR_16_PM with gs()

From: gjl at gcc dot gnu.org
Subject: [Bug ld/13899] [avr]: Wrong relaxation of R_AVR_16_PM with gs()
Date: Sat, 28 Apr 2012 12:33:28 +0000


--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-28 
12:33:28 UTC ---
(In reply to comment #2)
> Disassembly of section .text:
> 00000000 <menuitem_uhr>:
>    0:    0a 00 [...]
> 0000000e <onPixel_uhr>:
> The first entry of menuitem_uhr is 0x000a. The correct value 
> is 0x0007 = 0xe / 2, i.e. the word address of menuitem_uhr.

The word address of onPixel_uhr, of course.

Note: The testcase can be simplified even more to:

    call onPixel_uhr
.section .progmem.data,"a",@progbits
.type menuitem_uhr, @object
    .word gs(onPixel_uhr)

And then assembled/linked/dumped

$ avr-as -mmcu=atmega168 uhr.s -o uhr.o
$ avr-ld -o bug13899.elf -m avr5 --relax uhr.o
$ avr-objdump -d bug13899.elf

Disassembly of section .text:

00000000 <menuitem_uhr>:
   0:    03 00                                               ..

00000002 <__ctors_end>:
   2:    00 d0           rcall    .+0          ; 0x4 <onPixel_uhr>

00000004 <onPixel_uhr>:

The word address of onPixel_uhr is 0x0002, but menuitem_uhr recorded 0x0003.

The error also occurs if menuitem_uhr is located in .data instead of in section

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]