Bug 10856 - [2.20 regression] gas creates wrong code which results in a test failure in libcrypto++'s sha2 test
Summary: [2.20 regression] gas creates wrong code which results in a test failure in l...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
: 10906 (view as bug list)
Depends on:
Blocks: 11037
  Show dependency treegraph
 
Reported: 2009-10-27 23:54 UTC by Matthias Klose
Modified: 2010-12-19 18:18 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Last reconfirmed: 2009-10-28 06:46:51


Attachments
diff of disassembled files (842 bytes, text/plain)
2009-10-27 23:55 UTC, Matthias Klose
Details
sha .s and .o files (126.05 KB, application/x-lzma)
2009-10-27 23:56 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2009-10-27 23:54:55 UTC
The patch to fix PR gas/10704 causes sha.cpp assembled in a way that causes the
sha-256 test not to terminate. Undoing the patch runs the test fine. Replacing
the sha.o with one assembled with gas having this patch reverted lets the test pass.
Comment 1 Matthias Klose 2009-10-27 23:55:37 UTC
Created attachment 4329 [details]
diff of disassembled files
Comment 2 Matthias Klose 2009-10-27 23:56:18 UTC
Created attachment 4330 [details]
sha .s and .o files
Comment 3 Alan Modra 2009-10-28 02:53:32 UTC
Simpler testcase:

 .text
 .intel_syntax noprefix
 .space 5480
 .byte 0,0,0
0:
 .space 1620
 .byte 0
1:
 .space 2468
 nop
 jne 1b
 .space 52
 nop
 jl 0b

Without the .intel_syntax this assembles OK.
Comment 4 Sourceware Commits 2009-10-28 08:21:59 UTC
Subject: Bug 10856

CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2009-10-28 08:21:45

Modified files:
	gas            : ChangeLog expr.c 
	gas/testsuite  : ChangeLog 
	gas/testsuite/gas/i386: intelpic.d 

Log message:
	PR gas/10856
	* expr.c (resolve_expression): Only add "left" value to O_symbol
	expression when the symbol is undefined and different from the
	original symbol.  Simplify negative logic.
	
	* gas/i386/intelpic.d: Correct.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.3999&r2=1.4000
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/expr.c.diff?cvsroot=src&r1=1.78&r2=1.79
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1573&r2=1.1574
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.d.diff?cvsroot=src&r1=1.3&r2=1.4

Comment 5 Sourceware Commits 2009-10-28 08:24:03 UTC
Subject: Bug 10856

CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_20-branch
Changes by:	amodra@sourceware.org	2009-10-28 08:23:49

Modified files:
	gas            : ChangeLog expr.c 

Log message:
	PR gas/10856
	* expr.c (resolve_expression): Only add "left" value to O_symbol
	expression when the symbol is undefined and different from the
	original symbol.  Simplify negative logic.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.3938.2.27&r2=1.3938.2.28
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/expr.c.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.77.2.1&r2=1.77.2.2

Comment 6 Matthias Klose 2009-10-28 10:03:48 UTC
checked that the sha test passes, when sha.o is built with this patch.
Comment 7 Alan Modra 2009-10-28 10:08:48 UTC
.
Comment 8 Alan Modra 2009-11-05 12:14:29 UTC
*** Bug 10906 has been marked as a duplicate of this bug. ***
Comment 9 David-Sarah Hopwood 2009-12-13 17:55:22 UTC
Any indication of when this fix is likely to get into a release? The more OS 
distributions as 2.20 goes into, the more problems this bug will cause.
Comment 10 Zooko O'Whielacronx 2009-12-13 21:00:41 UTC
This launchpad page tracks the increasing number of OS distributions and open
source projects that are being negatively affected by the bug in 2.20:

https://bugs.launchpad.net/fedora/+source/binutils/+bug/461303
Comment 11 gingold@adacore.com 2009-12-14 09:04:48 UTC
Subject: Re:  [2.20 regression] gas creates wrong code which results in a test failure in libcrypto++'s sha2 test


On Dec 13, 2009, at 6:55 PM, david-sarah at jacaranda dot org wrote:

> 
> ------- Additional Comments From david-sarah at jacaranda dot org  2009-12-13 17:55 -------
> Any indication of when this fix is likely to get into a release? The more OS 
> distributions as 2.20 goes into, the more problems this bug will cause.

I agree that this is annoying.  What about a 2.20.1 release in January ?

Tristan.

Comment 12 Zooko O'Whielacronx 2010-07-06 04:44:56 UTC
Hey folks, some distributions such as MinGW have still not patched their version of binutils or reverted 
to binutils 2.19:

https://sourceforge.net/tracker/index.php?func=detail&aid=2913876&group_id=2435&atid=102435

This is still causing problems for my users:

http://tahoe-lafs.org/trac/tahoe-lafs/ticket/853

If you folks could go ahead and release a binutil 2.20.1 then that might stimulate distributors like 
MinGW to upgrade to it and that would fix the problem for my users. Thanks!
Comment 13 Zooko O'Whielacronx 2010-12-19 18:18:07 UTC
binutils 2.20.1, released 2010-03-03, does *not* have the ChangeLog entry from http://sourceware.org/bugzilla/show_bug.cgi?id=10856#c5 but *does* have the patch to expr.c. Weird. But I guess it is fixed in binutils 2.20.1.