This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][GAS/ARM] Better handling of difference between a symbol and an undefined symbol.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Alan Modra <amodra at gmail dot com>
- Date: Thu, 17 Mar 2011 06:18:35 -0700
- Subject: Re: [PATCH][GAS/ARM] Better handling of difference between a symbol and an undefined symbol.
- References: <4CA132F7.8020803@gmail.com> <AANLkTi=LnBj7U9V3PCrtUCoHj0QPV6d2VAKOwWJMw9T9@mail.gmail.com> <4CA1465D.30105@gmail.com> <AANLkTimewc4r=wh=ACmMJYkNgHcaiYWjM_Qe8xL+LKo2@mail.gmail.com> <AANLkTimpYE-k0c+LC2_AjgrGJ4XNRLypfSEYENU=jr4X@mail.gmail.com> <4CA1682D.8080500@gmail.com> <20100928041456.GU16376@bubble.grove.modra.org> <AANLkTinddt6Or0wcCN3Gh4U22C4QzwYoBDXA0S_CH3n6@mail.gmail.com> <20100929064955.GY16376@bubble.grove.modra.org> <AANLkTinnTc_Fathg_7SEhACBae3qNA8+ZoMPOmXJ-18e@mail.gmail.com> <20110317105901.GZ6275@bubble.grove.modra.org>
On Thu, Mar 17, 2011 at 3:59 AM, Alan Modra <amodra@gmail.com> wrote:
> This patch cures PR 12569 by simply removing the assert in
> get_known_segmented_expression, and allowing expr_section in do_org.
> A cop out, but it was proving difficult to properly set expression
> symbol sections as other places in gas assumed that a symbol in the
> absolute section could be resolved early. ?Besides, prior to the patch
> that introduced this regression all sorts of section nastiness could
> have hidden in expression symbols anyway.
>
> ? ? ? ?PR 12569
> ? ? ? ?* expr.c (operand): Correct passing of "mode" to expr.
> ? ? ? ?* read.c (do_org): Allow expr_section.
> ? ? ? ?(get_known_segmented_expression): Don't assert anything about the
> ? ? ? ?segment.
I checked in this testcase.
H.J.
---
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 6634781..155f1a9 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2011-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/12589
+ * gas/i386/pr12589-1.d: New.
+ * gas/i386/pr12589-1.s: Likewise.
+
+ * gas/i386/i386.exp: Run pr12589-1.
+
2011-03-16 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/bad-size.d: New.
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index ea5cdac..0eb151f 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -239,6 +239,9 @@ if [expr ([istarget "i*86-*-*"] || [istarget
"x86_64-*-*"]) && [gas_32_check]]
run_dump_test "secrel"
}
+ # Miscellaneous tests.
+ run_dump_test "pr12589-1"
+
set ASFLAGS "$old_ASFLAGS"
}
diff --git a/gas/testsuite/gas/i386/pr12589-1.d
b/gas/testsuite/gas/i386/pr12589-1.d
new file mode 100644
index 0000000..a89f225
--- /dev/null
+++ b/gas/testsuite/gas/i386/pr12589-1.d
@@ -0,0 +1,16 @@
+#name: i386 jump
+#objdump: -drw
+
+.*: +file format .*i386.*
+
+Disassembly of section .text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+: eb 02 jmp 4 <scn_pnp>
+
+0+2 <zerob>:
+ ...
+
+0+4 <scn_pnp>:
+[ ]*[a-f0-9]+: 89 c0 mov %eax,%eax
+#pass
diff --git a/gas/testsuite/gas/i386/pr12589-1.s
b/gas/testsuite/gas/i386/pr12589-1.s
new file mode 100644
index 0000000..19a37cc
--- /dev/null
+++ b/gas/testsuite/gas/i386/pr12589-1.s
@@ -0,0 +1,9 @@
+ .text
+ .globl _start
+_start:
+ jmp scn_pnp
+zerob:
+ zeroln = zerob - _start
+ .=.+zeroln
+scn_pnp:
+ mov %eax,%eax
>