[Bug ld/13402] using "-Wl,--relax" on the AVR port causes lss file and debug information to "lose sync" with generated code

2022-08-02 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=13402

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Alan Modra  ---
Closing, presumed fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/13402] using "-Wl,--relax" on the AVR port causes lss file and debug information to "lose sync" with generated code

2017-06-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=13402

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Senthil Kumar Selvaraj
:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6806377956c76c23ae96a3844e29412ae117e07a

commit 6806377956c76c23ae96a3844e29412ae117e07a
Author: Senthil Kumar Selvaraj 
Date:   Tue Jun 27 14:46:08 2017 +0530

Fix PR 13402

Fix incorrect adjustment of diff relocs when relaxing, and thus the
resulting source line to address mismatch.

Fix two issues when adjusting diff relocs to account for
deleted bytes.

1. Don't adjust the difference if the end address is the shrinked
insn's address i.e. use < instead of <=. The relaxation code deletes
count bytes from or after shrinked_insn_address, so the difference
between start_address and end_address should remain unchanged in this
case.

2. Adjust the reloc addend if the difference is to be adjusted and
symval + reloc addend is past the shrinked insn address. This is
because for a typical sym1 - sym2 diff reloc, sym1 is .text +
irel->r_addend, and the addend should be reduced to account for the
shrinked insn.

For example, assume the reloc value is .text + 0x8 with .text = 0, the
diff value in the object file = 0x4, and shrinked_insn_address = 0x4
with count = 0x2. Then the existing code writes 0x2 into the object
file to account for the deleted bytes, as shrinked_insn_address lies
between 0x8 and 0x8 - 0x4 = 0x4, but leaves the addend as is. The next
time the reloc is looked at, the code sees if a shrinked_insn_address
lies between 0x8 and 0x8 - 0x2 = 0x6, instead of 0x6 and 0x4. If there
happens to be one, then the diff value in the object file ends up
getting reduced again.

bfd/

2017-06-27  Senthil Kumar Selvaraj  

PR ld/13402
* elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
reloc addend if necessary. Adjust diff only if
shrinked_insn_address < end_address.

ld/

2017-06-27  Senthil Kumar Selvaraj  

PR ld/13402
* testsuite/ld-avr/pr13402.d: New test.
* testsuite/ld-avr/pr13402.s: New test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13402] using "-Wl,--relax" on the AVR port causes lss file and debug information to "lose sync" with generated code

2017-06-21 Thread saaadhu at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=13402

Senthil Kumar Selvaraj  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||saaadhu at gcc dot gnu.org

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13402] using -Wl,--relax on the AVR port causes lss file and debug information to lose sync with generated code

2011-11-11 Thread ilya.lesokhin at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13402

--- Comment #2 from Ilya Lesokhin ilya.lesokhin at gmail dot com 2011-11-12 
07:43:24 UTC ---
Created attachment 6053
  -- http://sourceware.org/bugzilla/attachment.cgi?id=6053
script to compile the code and generate to problematic lss file(test.lss)

-- 
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-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils