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
A patch is posted at https://mail.google.com/mail/?shva=1#all/1240c54aec8501cc
Oops. The patch is at http://sourceware.org/ml/binutils/2009-09/msg00742.html
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)
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
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
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
Doesn't segfault for me with current mainline or branch.
Sorry, my fault. It's ok here too. Thanks!
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
Fixed.
Subject: Bug 10704 CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2009-10-08 12:44:57 Modified files: gas/testsuite : ChangeLog gas/testsuite/gas/i386: intelok.d intelok.s intelpic.d intelpic.s Log message: 2009-10-08 H.J. Lu <hongjiu.lu@intel.com> PR gas/10704 * gas/i386/intelok.s: Move 2 PIC tests to ... * gas/i386/intelpic.s: Here. * gas/i386/intelok.d: Updated. * gas/i386/intelpic.d: Likewise. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1565&r2=1.1566 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelok.d.diff?cvsroot=src&r1=1.17&r2=1.18 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelok.s.diff?cvsroot=src&r1=1.11&r2=1.12 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.d.diff?cvsroot=src&r1=1.2&r2=1.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.s.diff?cvsroot=src&r1=1.1&r2=1.2
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