Don't force "set" symbols local for PE
authorAlan Modra <amodra@gmail.com>
Sat, 12 Jul 2014 07:35:35 +0000 (17:05 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 12 Jul 2014 09:20:53 +0000 (18:50 +0930)
gas/
* read.c (assign_symbol): Don't force "set" symbols local for PE.
gas/testsuite/
* gas/pe/set.s, * gas/pe/set.d: New test.
* gas/pe/pe.exp: Run it.

gas/ChangeLog
gas/read.c
gas/testsuite/ChangeLog
gas/testsuite/gas/pe/pe.exp
gas/testsuite/gas/pe/set.d [new file with mode: 0644]
gas/testsuite/gas/pe/set.s [new file with mode: 0644]

index 9c183e4445a3c9aa3f891215aba02df26ff97b73..2ef1adf4817e07db9856427f5b5bc11e487009d6 100644 (file)
@@ -1,3 +1,7 @@
+2014-07-12  David Majnemer  <david.majnemer@gmail.com>
+
+       * read.c (assign_symbol): Don't force "set" symbols local for PE.
+
 2014-07-08  Jiong Wang  <jiong.wang@arm.com>
 
        * config/tc-arm.c (literal_pool): New field "alignment".
index 8e1b06edf6bdad5e0f412bc1b22de8f57ef4ac1c..183ef2c8fd97f0193e64a2c0382099a5b00d287a 100644 (file)
@@ -3187,7 +3187,7 @@ assign_symbol (char *name, int mode)
          symbol_set_frag (symbolP, dummy_frag);
        }
 #endif
-#ifdef OBJ_COFF
+#if defined (OBJ_COFF) && !defined (TE_PE)
       /* "set" symbols are local unless otherwise specified.  */
       SF_SET_LOCAL (symbolP);
 #endif
index a7a69465c2bd0f34a58a89efde2812598aeb7bf9..4e91b37ef7024833499d0fd5e93538288538811c 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-12  David Majnemer <david.majnemer@gmail.com>
+
+       * gas/pe/set.s, * gas/pe/set.d: New test.
+       * gas/pe/pe.exp: Run it.
+
 2014-07-10  Will Newton  <will.newton@linaro.org>
 
        * gas/elf/elf.exp: Remove special handling of arm-elf for
index c1c5f49923720c382affd0db080960c62a00b451..0fab53d8496c1c3d0f53efa1c883d75c0546b83a 100644 (file)
@@ -36,6 +36,8 @@ run_dump_test "section-align-1"
 run_dump_test "section-align-3"
 run_dump_test "section-exclude"
 
+run_dump_test "set"
+
 # SEH related tests
 
 # These tests are only for x86_64 targets
diff --git a/gas/testsuite/gas/pe/set.d b/gas/testsuite/gas/pe/set.d
new file mode 100644 (file)
index 0000000..99f2d5a
--- /dev/null
@@ -0,0 +1,11 @@
+#nm: --defined-only
+#name: set directive in COFF
+#
+# Ensure that we stick an entry for the left hand side of a set directive
+# depending on the name of the left hand side.
+
+#...
+.* t _b
+#...
+.* T _d
+#...
diff --git a/gas/testsuite/gas/pe/set.s b/gas/testsuite/gas/pe/set.s
new file mode 100644 (file)
index 0000000..a19e797
--- /dev/null
@@ -0,0 +1,9 @@
+L_a:
+.long   0
+
+_b = L_a
+
+L_c = L_a
+
+.globl _d
+_d = L_a