* [PATCH v2] config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate.
@ 2013-11-01 22:24 Will Newton
2013-11-05 12:34 ` Marcus Shawcroft
0 siblings, 1 reply; 3+ messages in thread
From: Will Newton @ 2013-11-01 22:24 UTC (permalink / raw)
To: binutils; +Cc: Patch Tracking
Parsing a vector mov instruction currently leads to a phantom undefined
symbol being added to the symbol table. e.g.:
.text
mov x0, v0.D[0]
Produces an undefined symbol called "v0.D".
gas/ChangeLog:
2013-11-01 Will Newton <will.newton@linaro.org>
PR gas/16103
* config/tc-aarch64.c (parse_operands): Avoid trying to
parse a vector register as an immediate.
gas/testsuite/ChangeLog:
2013-11-01 Will Newton <will.newton@linaro.org>
* gas/aarch64/advsimd-mov-bad.d: New file.
* gas/aarch64/advsimd-mov-bad.s: Likewise.
---
gas/config/tc-aarch64.c | 3 ++-
gas/testsuite/gas/aarch64/advsimd-mov-bad.d | 12 ++++++++++++
gas/testsuite/gas/aarch64/advsimd-mov-bad.s | 2 ++
3 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644 gas/testsuite/gas/aarch64/advsimd-mov-bad.d
create mode 100644 gas/testsuite/gas/aarch64/advsimd-mov-bad.s
Changes in v2:
- Add testcase
- Add PR to changelog
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 14ffdad..02fe4de 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -4810,7 +4810,8 @@ parse_operands (char *str, const aarch64_opcode *opcode)
case AARCH64_OPND_IMM_MOV:
{
char *saved = str;
- if (reg_name_p (str, REG_TYPE_R_Z_SP))
+ if (reg_name_p (str, REG_TYPE_R_Z_SP) ||
+ reg_name_p (str, REG_TYPE_VN))
goto failure;
str = saved;
po_misc_or_fail (my_get_expression (&inst.reloc.exp, &str,
diff --git a/gas/testsuite/gas/aarch64/advsimd-mov-bad.d b/gas/testsuite/gas/aarch64/advsimd-mov-bad.d
new file mode 100644
index 0000000..6ca9887
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/advsimd-mov-bad.d
@@ -0,0 +1,12 @@
+#source: advsimd-mov-bad.s
+#readelf: -s --wide
+
+Symbol table '.symtab' contains 6 entries:
+ +Num:.*
+ +[0-9]+:.*
+ +[0-9]+:.*
+ +[0-9]+:.*
+ +[0-9]+:.*
+ +[0-9]+:.*
+#failif
+ +[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND v0.D
diff --git a/gas/testsuite/gas/aarch64/advsimd-mov-bad.s b/gas/testsuite/gas/aarch64/advsimd-mov-bad.s
new file mode 100644
index 0000000..d7ba226
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/advsimd-mov-bad.s
@@ -0,0 +1,2 @@
+ .text
+ mov x0, v0.D[0]
--
1.8.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate.
2013-11-01 22:24 [PATCH v2] config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate Will Newton
@ 2013-11-05 12:34 ` Marcus Shawcroft
2013-11-05 14:38 ` Will Newton
0 siblings, 1 reply; 3+ messages in thread
From: Marcus Shawcroft @ 2013-11-05 12:34 UTC (permalink / raw)
To: Will Newton; +Cc: binutils, Patch Tracking
OK thanks Will. I think this should be back ported.
/Marcus
On 1 November 2013 22:24, Will Newton <will.newton@linaro.org> wrote:
>
> Parsing a vector mov instruction currently leads to a phantom undefined
> symbol being added to the symbol table. e.g.:
>
> .text
> mov x0, v0.D[0]
>
> Produces an undefined symbol called "v0.D".
>
> gas/ChangeLog:
>
> 2013-11-01 Will Newton <will.newton@linaro.org>
>
> PR gas/16103
> * config/tc-aarch64.c (parse_operands): Avoid trying to
> parse a vector register as an immediate.
>
> gas/testsuite/ChangeLog:
>
> 2013-11-01 Will Newton <will.newton@linaro.org>
>
> * gas/aarch64/advsimd-mov-bad.d: New file.
> * gas/aarch64/advsimd-mov-bad.s: Likewise.
> ---
> gas/config/tc-aarch64.c | 3 ++-
> gas/testsuite/gas/aarch64/advsimd-mov-bad.d | 12 ++++++++++++
> gas/testsuite/gas/aarch64/advsimd-mov-bad.s | 2 ++
> 3 files changed, 16 insertions(+), 1 deletion(-)
> create mode 100644 gas/testsuite/gas/aarch64/advsimd-mov-bad.d
> create mode 100644 gas/testsuite/gas/aarch64/advsimd-mov-bad.s
>
> Changes in v2:
> - Add testcase
> - Add PR to changelog
>
> diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
> index 14ffdad..02fe4de 100644
> --- a/gas/config/tc-aarch64.c
> +++ b/gas/config/tc-aarch64.c
> @@ -4810,7 +4810,8 @@ parse_operands (char *str, const aarch64_opcode *opcode)
> case AARCH64_OPND_IMM_MOV:
> {
> char *saved = str;
> - if (reg_name_p (str, REG_TYPE_R_Z_SP))
> + if (reg_name_p (str, REG_TYPE_R_Z_SP) ||
> + reg_name_p (str, REG_TYPE_VN))
> goto failure;
> str = saved;
> po_misc_or_fail (my_get_expression (&inst.reloc.exp, &str,
> diff --git a/gas/testsuite/gas/aarch64/advsimd-mov-bad.d b/gas/testsuite/gas/aarch64/advsimd-mov-bad.d
> new file mode 100644
> index 0000000..6ca9887
> --- /dev/null
> +++ b/gas/testsuite/gas/aarch64/advsimd-mov-bad.d
> @@ -0,0 +1,12 @@
> +#source: advsimd-mov-bad.s
> +#readelf: -s --wide
> +
> +Symbol table '.symtab' contains 6 entries:
> + +Num:.*
> + +[0-9]+:.*
> + +[0-9]+:.*
> + +[0-9]+:.*
> + +[0-9]+:.*
> + +[0-9]+:.*
> +#failif
> + +[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND v0.D
> diff --git a/gas/testsuite/gas/aarch64/advsimd-mov-bad.s b/gas/testsuite/gas/aarch64/advsimd-mov-bad.s
> new file mode 100644
> index 0000000..d7ba226
> --- /dev/null
> +++ b/gas/testsuite/gas/aarch64/advsimd-mov-bad.s
> @@ -0,0 +1,2 @@
> + .text
> + mov x0, v0.D[0]
> --
> 1.8.1.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate.
2013-11-05 12:34 ` Marcus Shawcroft
@ 2013-11-05 14:38 ` Will Newton
0 siblings, 0 replies; 3+ messages in thread
From: Will Newton @ 2013-11-05 14:38 UTC (permalink / raw)
To: Marcus Shawcroft; +Cc: binutils, Patch Tracking
On 5 November 2013 12:34, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
> OK thanks Will. I think this should be back ported.
> /Marcus
Thanks, pushed to HEAD and the 2.24 branch.
--
Will Newton
Toolchain Working Group, Linaro
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-05 14:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-01 22:24 [PATCH v2] config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate Will Newton
2013-11-05 12:34 ` Marcus Shawcroft
2013-11-05 14:38 ` Will Newton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).