Summary: | invalid code generation depending on code position | ||
---|---|---|---|
Product: | binutils | Reporter: | serpilliere <serpilliere> |
Component: | gas | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | amodra, bug-binutils, hjl.tools |
Priority: | P2 | ||
Version: | 2.20 | ||
Target Milestone: | --- | ||
Host: | Target: | i486-* | |
Build: | Last reconfirmed: | ||
Bug Depends on: | 10856 | ||
Bug Blocks: | |||
Attachments: | A patch |
Description
serpilliere
2009-12-01 09:06:56 UTC
It is a regression. Binutils 2.19 works correctly. It is an assembler bug. It is caused by: http://sourceware.org/ml/binutils-cvs/2009-10/msg00245.html Created attachment 4449 [details]
A patch
The problem is in
else if (seg_left == undefined_section
&& add_symbol != orig_add_symbol)
seg_left == undefined_section is wrong. However, add_symbol != orig_add_symbol
isn't reliable since local symbol may be converted. This patch works for the
testcase. If it is OK, I will submit a complete patch with some testcases.
Ah ha! I wanted to get rid of seg_left == undefined_section too, but hadn't spotted the problem with local symbols. Your patch looks good except for the calls to local_symbol_convert, which are unnecessary work and memory usage. A patch is posted at http://sourceware.org/ml/binutils/2009-12/msg00095.html Subject: Bug 11037 CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2009-12-08 03:14:29 Modified files: gas : ChangeLog expr.c symbols.c symbols.h gas/testsuite : ChangeLog gas/testsuite/gas/i386: intelpic.d intelpic.s Log message: Call symbol_same_p to check to if 2 symbols are the same. gas/ 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-07 H.J. Lu <hongjiu.lu@intel.com> PR gas/11037 * gas/i386/intelpic.s: Add testcases. * gas/i386/intelpic.d: Updated. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4034&r2=1.4035 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/expr.c.diff?cvsroot=src&r1=1.79&r2=1.80 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.c.diff?cvsroot=src&r1=1.100&r2=1.101 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/symbols.h.diff?cvsroot=src&r1=1.31&r2=1.32 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1601&r2=1.1602 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.d.diff?cvsroot=src&r1=1.4&r2=1.5 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/intelpic.s.diff?cvsroot=src&r1=1.2&r2=1.3 HJ, please apply your patch to the 2.20 branch so the bug can be closed. Subject: Bug 11037 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 Fixed. |