Bug 19047 - gold --icf vs REL with negative addend
Summary: gold --icf vs REL with negative addend
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.27
Assignee: Sriraman Tallam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-01 17:11 UTC by Roland McGrath
Modified: 2016-05-05 20:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland McGrath 2015-10-01 17:11:45 UTC
See https://sourceware.org/ml/binutils/2015-09/msg00243.html

Sriraram is looking into a small reproducer.
Comment 1 cvs-commit@gcc.gnu.org 2016-05-05 20:15:22 UTC
The binutils-2_26-branch branch has been updated by Roland McGrath <roland@sourceware.org>:

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

commit d114b830426300f80302ca03ff4322942f63c615
Author: Roland McGrath <mcgrathr@chromium.org>
Date:   Thu May 5 13:12:40 2016 -0700

    2016-02-05  Sriraman Tallam  <tmsriram@google.com>
    
    	PR gold/19047
    	* icf.cc (get_rel_addend): New function.
    	(get_section_contents):  Move merge section addend computation to a
    	new function.  Ignore negative values for SHT_REL and SHT_RELA addends.
    	Fix bug to not read past the length of the section.
    
    Fix bug related to addend computation for MERGE sections.
    
    (cherry picked from commit 84d543b7ed93bf6511cdf45791f4f0b717dfb718)
Comment 2 Roland McGrath 2016-05-05 20:17:15 UTC
This wasn't fixed in 2.26 but the fix is now backported to 2.26.
It won't be backported to 2.25 since 2.26 is already out.
So I'm marking it fixed and changing the version reported for to 2.26.