From 76bd66cfb5207137dac01534cf7d8af8f708743b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 12 Jul 2014 17:05:35 +0930 Subject: [PATCH] Don't force "set" symbols local for PE 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 | 4 ++++ gas/read.c | 2 +- gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/pe/pe.exp | 2 ++ gas/testsuite/gas/pe/set.d | 11 +++++++++++ gas/testsuite/gas/pe/set.s | 9 +++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/pe/set.d create mode 100644 gas/testsuite/gas/pe/set.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 9c183e4445a..2ef1adf4817 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2014-07-12 David Majnemer + + * read.c (assign_symbol): Don't force "set" symbols local for PE. + 2014-07-08 Jiong Wang * config/tc-arm.c (literal_pool): New field "alignment". diff --git a/gas/read.c b/gas/read.c index 8e1b06edf6b..183ef2c8fd9 100644 --- a/gas/read.c +++ b/gas/read.c @@ -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 diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index a7a69465c2b..4e91b37ef70 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-07-12 David Majnemer + + * gas/pe/set.s, * gas/pe/set.d: New test. + * gas/pe/pe.exp: Run it. + 2014-07-10 Will Newton * gas/elf/elf.exp: Remove special handling of arm-elf for diff --git a/gas/testsuite/gas/pe/pe.exp b/gas/testsuite/gas/pe/pe.exp index c1c5f499237..0fab53d8496 100644 --- a/gas/testsuite/gas/pe/pe.exp +++ b/gas/testsuite/gas/pe/pe.exp @@ -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 index 00000000000..99f2d5a7ea7 --- /dev/null +++ b/gas/testsuite/gas/pe/set.d @@ -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 index 00000000000..a19e79720f1 --- /dev/null +++ b/gas/testsuite/gas/pe/set.s @@ -0,0 +1,9 @@ +L_a: +.long 0 + +_b = L_a + +L_c = L_a + +.globl _d +_d = L_a -- 2.30.2