diff options
author | Alex Coplan <alex.coplan@arm.com> | 2020-10-06 15:56:44 +0100 |
---|---|---|
committer | Alex Coplan <alex.coplan@arm.com> | 2020-10-06 15:56:44 +0100 |
commit | 05cfb0d8cc9b7f8676f5ae55a93642f091d5405f (patch) | |
tree | c85ab3d18c56b8ae2d8057ae091c36c774748cbf /gas/config | |
parent | 0ec992e6647c00fc234cdf4c11732b6711b024af (diff) | |
download | binutils-05cfb0d8cc9b7f8676f5ae55a93642f091d5405f.zip binutils-05cfb0d8cc9b7f8676f5ae55a93642f091d5405f.tar.gz binutils-05cfb0d8cc9b7f8676f5ae55a93642f091d5405f.tar.bz2 |
aarch64: Fix bogus type punning in parse_barrier() [PR26699]
This patch fixes a bogus use of type punning in parse_barrier() which
was causing an assembly failure on big endian LP64 hosts when attempting
to assemble "isb sy" for AArch64.
The type of the entries in aarch64_barrier_opt_hsh is
aarch64_name_value_pair. We were incorrectly casting this to the
locally-defined asm_barrier_opt which has a wider type (on LP64) for the
second member. This happened to work on little-endian hosts but fails on
LP64 big endian.
The fix is to use the correct type in parse_barrier(). This makes the
locally-defined asm_barrier_opt redundant, so remove it.
gas/ChangeLog:
* config/tc-aarch64.c (asm_barrier_opt): Delete.
(parse_barrier): Fix bogus type punning.
* testsuite/gas/aarch64/system.d: Update disassembly.
* testsuite/gas/aarch64/system.s: Add isb sy test.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-aarch64.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 4bcfa05..fac571e 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -250,12 +250,6 @@ set_fatal_syntax_error (const char *error) typedef struct { const char *template; - unsigned long value; -} asm_barrier_opt; - -typedef struct -{ - const char *template; uint32_t value; } asm_nzcv; @@ -3993,7 +3987,7 @@ static int parse_barrier (char **str) { char *p, *q; - const asm_barrier_opt *o; + const struct aarch64_name_value_pair *o; p = q = *str; while (ISALPHA (*q)) |