Bug 10704 - as segfault in memory lookup intel syntax
Summary: as segfault in memory lookup intel syntax
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-29 14:55 UTC by serpilliere
Modified: 2009-10-07 20:03 UTC (History)
1 user (show)

See Also:
Host:
Target: i386-*-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description serpilliere 2009-09-29 14:55:17 UTC
as segfault during parsing of some assembly files written in intel syntax

$ as --version
GNU assembler (GNU Binutils for Debian) 2.19.91.20090910


$ cat o.s 
.intel_syntax 
.L11:
        jmp     DWORD PTR[ .L11  + %eax * 4 ]

$ as o.s 
Erreur de segmentation
Comment 1 H.J. Lu 2009-09-30 19:02:47 UTC
A patch is posted at

https://mail.google.com/mail/?shva=1#all/1240c54aec8501cc
Comment 2 H.J. Lu 2009-09-30 19:13:58 UTC
Oops. The patch is at

http://sourceware.org/ml/binutils/2009-09/msg00742.html
Comment 3 serpilliere 2009-10-01 15:33:07 UTC
The patch avoid seg fault. But It still doesn't assemble such code (a little bit
different):

$ cat ccMaqFcN.s
.intel_syntax
.LC0:
.string "dummy"
        lea     %eax, DWORD PTR[ .LC0@GOTOFF + %ebx ]
$ gas/as-new ccMaqFcN.s_cp 
ccMaqFcN.s_cp: Assembler messages:
ccMaqFcN.s_cp:4: Internal error, aborting at symbols.c line 2180 in S_SET_SEGMENT
Please report this bug.


$ gas/as-new --version
GNU assembler (GNU Binutils) 2.20.51.20091001
(with patch applied)


Comment 4 Sourceware Commits 2009-10-05 21:58:31 UTC
Subject: Bug 10704

CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2009-10-05 21:58:19

Modified files:
	gas            : ChangeLog symbols.c 

Log message:
	PR gas/10704
	* symbols.c (snapshot_symbol): Revert 2006-01-09 patch for PR2117.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.3978&r2=1.3979
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.c.diff?cvsroot=src&r1=1.99&r2=1.100

Comment 5 serpilliere 2009-10-07 08:34:13 UTC
I applyied both patch;
If I test the ccMaqFcN.s file, it doesn't assert but it segfault again:

$ cat ccMaqFcN.s_cp
.intel_syntax
.LC0:
.string "dummy"
        lea     %eax, DWORD PTR[ .LC0@GOTOFF + %ebx ]
$ as ccMaqFcN.s_cp
Erreur de segmentation



With patch applied from:
http://sourceware.org/ml/binutils/2009-09/msg00742.html
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.3978&r2=1.3979
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.c.diff?cvsroot=src&r1=1.99&r2=1.100

Comment 6 Sourceware Commits 2009-10-07 08:37:02 UTC
Subject: Bug 10704

CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_20-branch
Changes by:	amodra@sourceware.org	2009-10-07 08:36:44

Modified files:
	gas            : ChangeLog symbols.c 

Log message:
	PR gas/10704
	* symbols.c (snapshot_symbol): Revert 2006-01-09 patch for PR2117.

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.24&r2=1.3938.2.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.c.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.96.2.3&r2=1.96.2.4

Comment 7 Alan Modra 2009-10-07 11:43:26 UTC
Doesn't segfault for me with current mainline or branch.
Comment 8 serpilliere 2009-10-07 12:18:05 UTC
Sorry, my fault.
It's ok here too. Thanks!
Comment 9 Sourceware Commits 2009-10-07 20:02:24 UTC
Subject: Bug 10704

CVSROOT:	/cvs/src
Module name:	src
Changes by:	hjl@sourceware.org	2009-10-07 20:02:06

Modified files:
	gas/testsuite  : ChangeLog 
	gas/testsuite/gas/i386: intelok.d intelok.s 

Log message:
	2009-10-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR gas/10704
	* gas/i386/intelok.s: Add 2 new tests.
	* gas/i386/intelok.d: Updated.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1564&r2=1.1565
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelok.d.diff?cvsroot=src&r1=1.16&r2=1.17
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelok.s.diff?cvsroot=src&r1=1.10&r2=1.11

Comment 10 H.J. Lu 2009-10-07 20:03:17 UTC
Fixed.
Comment 12 Sourceware Commits 2009-12-16 01:52:36 UTC
Subject: Bug 10704

CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_20-branch
Changes by:	hjl@sourceware.org	2009-12-16 01:52:14

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

Log message:
	Fix PR gas/11037.
	
	gas/
	
	2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>
	
	Backport from trunk:
	2009-12-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR gas/11037
	* expr.c (resolve_expression): Call symbol_same_p to check
	if 2 symbols are the same.
	
	* symbols.c (symbol_same_p): New.
	* symbols.h (symbol_same_p): Likewise.
	
	gas/testsuite/
	
	2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>
	
	Backport from trunk:
	2009-12-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR gas/11037
	* gas/i386/intelpic.s: Add testcases.
	* gas/i386/intelpic.d: Updated.
	
	2009-10-28  Alan Modra  <amodra@bigpond.net.au>
	
	* gas/i386/intelpic.d: Correct.
	
	2009-10-08  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR gas/10704
	* gas/i386/intelpic.s: Add 2 new tests.
	* gas/i386/intelpic.d: Updated.

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.29&r2=1.3938.2.30
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.2&r2=1.77.2.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.c.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.96.2.4&r2=1.96.2.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.h.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.31&r2=1.31.2.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.1537.2.14&r2=1.1537.2.15
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.d.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.2&r2=1.2.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.s.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.1&r2=1.1.34.1