[PATCH 1/3] arm: don't engage symver scrubber hack in CCS mode
Jan Beulich
jbeulich@suse.com
Mon Sep 2 09:34:37 GMT 2024
In that mode the comment char is ; while @ has no special meaning.
Engaging the special logic in that case results in comments not being
respected on .symver lines.
---
The ignoring of @ as a comment char also goes too far, imo: It really
only needs special casing from the 1st comma onwards until the possible
2nd one.
--- a/gas/app.c
+++ b/gas/app.c
@@ -810,7 +810,9 @@ do_scrub_chars (size_t (*get) (char *, s
in this function. */
if (symver_state == NULL)
{
- if ((state == 0 || state == 1) && ch == symver_pseudo[0])
+ if ((state == 0 || state == 1)
+ && strchr (tc_comment_chars, '@') != NULL
+ && ch == symver_pseudo[0])
symver_state = symver_pseudo + 1;
}
else
--- /dev/null
+++ b/gas/testsuite/gas/arm/ccs-symver.d
@@ -0,0 +1,10 @@
+#name: .symver in CCS mode
+#as: -mccs
+#readelf: -sW
+# This test is only valid on ELF based ports.
+#notarget: *-*-pe *-*-wince
+
+#...
+ +[0-9]+: +0+ +1 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +0+ +1 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo@version1
+#pass
--- /dev/null
+++ b/gas/testsuite/gas/arm/ccs-symver.s
@@ -0,0 +1,7 @@
+ .data
+ .globl foo
+ .type foo,@object
+foo:
+ .byte 0
+ .size foo,.-foo
+ .symver foo,foo@version1;remove
More information about the Binutils
mailing list