[PR19620][GAS][AARCH64]Remove mov[z,k,n] relocation symbol name restriction.
Renlin Li
renlin.li@foss.arm.com
Fri Feb 12 14:43:00 GMT 2016
Hi all,
In AArch64 gas, register name or string starts with valid register name
is not allowed as symbol name for mov[z,k,n] instruction.
For example, the following instruction is illegal according to current
implementation. Because 'x2' is viewed as a register.
movk x2, #:abs_g0_nc: x2.22
movk x2, #:abs_g0_nc: x2
The same restriction applies to any w/x register and sp/wzr/xzr register.
However, this is possible in real world. I came across this when compiling a
gcc test case: testsuite/gcc.dg/trampoline-1.c
This test case generates function name such as "x2.22".
On the other hand, this restriction isn't constantly applied.
It's allowed in add instruction with relocation.
The following instruction is legal.
add x2, x1, #:lo12: x2.22
There is line of a comment in related parsing function saying
"Avoid parsing a register as a general symbol"
gnu as documentation about symbol name doesn't mention this kind of
restriction. Is there any particular reasons I have missed?
The patch here is to remove this restriction on symbol name for mov[z,n,k]
instruction. A test case is also added.
Passes binutils regression. Ok to for trunk and backport to 2.26?
Regards,
Renlin Li
gas/ChangeLog:
2016-02-12 Renlin Li <renlin.li@arm.com>
PR gas/19620
* config/tc-aarch64.c (parse_half): Remove restrictions on symbol
name.
* testsuite/gas/aarch64/movw_label.d: New.
* testsuite/gas/aarch64/movw_label.s: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.patch
Type: text/x-patch
Size: 2265 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160212/a841a015/attachment.bin>
More information about the Binutils
mailing list