bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/12494] Relaxation leads to wrong code optimization (computed got


From: senthil.thecoder at gmail dot com
Subject: [Bug ld/12494] Relaxation leads to wrong code optimization (computed goto)
Date: Tue, 12 Mar 2013 18:02:51 +0000

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

Senthil Kumar Selvaraj <senthil.thecoder at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |senthil.thecoder at gmail
                   |                            |dot com

--- Comment #9 from Senthil Kumar Selvaraj <senthil.thecoder at gmail dot com> 
2013-03-12 18:02:51 UTC ---
Actually, the linker relaxation code already considers cases where deletion of
the ret in call/ret or jmp/ret might be unsafe - just that it missed this
specific case.

The case being that GCC puts the array containing the addresses of the labels
in a separate section (.rodata). The safe ret deletion logic assumes that only
relocations in the local section (containing the ret) could potentially have
symbols whose values evaluate to the address containing the ret, but that is
not true in this case.

Looping over all sections in the BFD, and repeating the check for each section
fixes the problem (see attached patch).

Changelog

2013-03-12  Senthil Kumar Selvaraj  <address@hidden>

    * bfd/elf32-avr.c: Consider all sections to determine if linker
      relaxation can safely delete a ret after a call/jmp

-- 
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]