[binutils-gdb] arm: don't engage symver scrubber hack in CCS mode
Jan Beulich
jbeulich@sourceware.org
Wed Sep 11 11:56:42 GMT 2024
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9135fac423c2ddd475b39c9e8ba647c202d72859
commit 9135fac423c2ddd475b39c9e8ba647c202d72859
Author: Jan Beulich <jbeulich@suse.com>
Date: Wed Sep 11 13:55:01 2024 +0200
arm: don't engage symver scrubber hack in CCS mode
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.
Diff:
---
gas/app.c | 4 +++-
gas/testsuite/gas/arm/ccs-symver.d | 10 ++++++++++
gas/testsuite/gas/arm/ccs-symver.s | 7 +++++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/gas/app.c b/gas/app.c
index 41ba4163a2a..bca3c3e8146 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -805,7 +805,9 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen,
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
diff --git a/gas/testsuite/gas/arm/ccs-symver.d b/gas/testsuite/gas/arm/ccs-symver.d
new file mode 100644
index 00000000000..c1255abdcb4
--- /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
diff --git a/gas/testsuite/gas/arm/ccs-symver.s b/gas/testsuite/gas/arm/ccs-symver.s
new file mode 100644
index 00000000000..00a96f5dc90
--- /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-cvs
mailing list