From eba874d8d0cccffd0f3d24d87f5d229d3a8c3240 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 29 Apr 2003 11:52:37 +0000 Subject: [PATCH] Fix problem parsing symbol version strings when they are preceeded by whitespace. Add test to catch this problem in the future. --- gas/ChangeLog | 5 +++++ gas/config/obj-elf.c | 1 + gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/elf/elf.exp | 1 + gas/testsuite/gas/elf/symver.d | 17 +++++++++++++++++ gas/testsuite/gas/elf/symver.s | 6 ++++++ 6 files changed, 36 insertions(+) create mode 100644 gas/testsuite/gas/elf/symver.d create mode 100644 gas/testsuite/gas/elf/symver.s diff --git a/gas/ChangeLog b/gas/ChangeLog index f9eec49..3417eb2 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2003-04-29 Nick Clifton + + * config/obj-elf.c (obj_elf_symver): Skip whitespace before the + start of a version name. + 2003-04-28 Chris Demetriou * configure.in (mips-*-*n*bsd*): Replace with... diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 6c15704..7c2423c 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1269,6 +1269,7 @@ obj_elf_symver (ignore) } ++input_line_pointer; + SKIP_WHITESPACE (); name = input_line_pointer; /* Temporarily include '@' in symbol names. */ diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index e619931..381233c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2003-04-29 Nick Clifton + + * gas/elf/elf.exp: Invoke symver test. + * gas/elf/symver.s: New test case. + * gas/elf/symver.d: Expected output. + 2003-04-24 Nick Clifton * gas/ppc/astest2.s: Add tests for conditional branches with diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp index a967cb7..c9aa34d 100644 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -53,4 +53,5 @@ if { ([istarget "*-*-elf*"] run_dump_test "section0" run_dump_test "section1" run_list_test "section2" "$target_machine" "-al" + run_dump_test "symver" } diff --git a/gas/testsuite/gas/elf/symver.d b/gas/testsuite/gas/elf/symver.d new file mode 100644 index 0000000..67b8a4c --- /dev/null +++ b/gas/testsuite/gas/elf/symver.d @@ -0,0 +1,17 @@ +#objdump: --syms +#name: ELF symbol versioning +# +# The #... and #pass are there to match extra symbols inserted by +# some toolchains, eg the mips-elf port will add .reginfo and .ptrd + +dump.o: file format .* + +SYMBOL TABLE: + +0+000 l.*d.*\.text.*0+000.* +0+000 l.*d.*\.data.*0+000.* +0+000 l.*d.*\.bss.*0+000.* +#... +0+000 l.*O.*\.data.*0+004 x +0+000 l.*O.*\.data.*0+004 x@VERS\.0 +#pass diff --git a/gas/testsuite/gas/elf/symver.s b/gas/testsuite/gas/elf/symver.s new file mode 100644 index 0000000..dd2315b --- /dev/null +++ b/gas/testsuite/gas/elf/symver.s @@ -0,0 +1,6 @@ + .data + .type x,@object + .size x,4 +x: + .word 12 + .symver x, x@VERS.0 -- 2.7.4