[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: |
Fri, 27 Apr 2012 23:50:14 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=13899
--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-27
23:50:14 UTC ---
Created attachment 6379
--> http://sourceware.org/bugzilla/attachment.cgi?id=6379
uhr.s
Here is a condensed test case.
The first entry of menuitem_uhr shall contain the word address of onPixel_uhr:
.global menuitem_uhr
.section .progmem.data,"a",@progbits
.type menuitem_uhr, @object
menuitem_uhr:
.word gs(onPixel_uhr)
But avr-ld generates a wrong entry 0x000a instead of the correct 0x0007.
With the attached assembler file, perform
$ avr-as -mmcu=atmega168 uhr.s -o uhr.o
$ avr-ld -o bug13899.elf -m avr5 -Tdata 0x800100 --relax -defsym morse=0 -v
uhr.o
$ avr-objdump -h -S -j .data -j .text bug13899.elf
The output is:
GNU ld (GNU Binutils) 2.22.52.20120322
bug13899.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000016 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
Disassembly of section .text:
00000000 <menuitem_uhr>:
0: 0a 00 06 00 04 00 04 00 ........
00000008 <__ctors_end>:
8: fb df rcall .-10 ; 0x0 <menuitem_uhr>
0000000a <onRedraw_uhr>:
a: fa df rcall .-12 ; 0x0 <menuitem_uhr>
c: f9 df rcall .-14 ; 0x0 <menuitem_uhr>
0000000e <onPixel_uhr>:
e: f8 df rcall .-16 ; 0x0 <menuitem_uhr>
10: f7 df rcall .-18 ; 0x0 <menuitem_uhr>
12: f6 df rcall .-20 ; 0x0 <menuitem_uhr>
14: f5 df rcall .-22 ; 0x0 <menuitem_uhr>
The first entry of menuitem_uhr is 0x000a.
The correct value is 0x0007 = 0xe / 2, i.e. the word address of menuitem_uhr.
--
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.
- [Bug ld/13899] [avr]: Wrong relaxation of R_AVR_16_PM with gs(),
gjl at gcc dot gnu.org <=