aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorRamana Radhakrishnan <ramana.radhakrishnan@arm.com>2017-08-15 13:58:01 +0100
committerRamana Radhakrishnan <ramana.radhakrishnan@arm.com>2017-08-15 13:58:01 +0100
commit8975f864092f0a1ba561622ba137b305da4a362f (patch)
treec45001e5cfe5917de025e4433410b779cd891689 /gas/config
parentbf0ec4c2769236d9c471685409605f50b01479e5 (diff)
downloadgdb-8975f864092f0a1ba561622ba137b305da4a362f.zip
gdb-8975f864092f0a1ba561622ba137b305da4a362f.tar.gz
gdb-8975f864092f0a1ba561622ba137b305da4a362f.tar.bz2
[Patch AArch64] Turn lr, fp, ip0 and ip1 into proper aliases
We got a report from the linux-arm-kernel folks about getting spurious warnings when building the kernel with binutils 2.29. See https://www.spinics.net/lists/arm-kernel/msg599929.html which boils down to this testcase. $> cat /tmp/tst.s lr .req x30 /tmp/tst.s: Assembler messages: /tmp/tst.s:1: Warning: ignoring attempt to redefine built-in register 'lr' Instead let's treat this as a proper alias at startup time thus avoiding the problem and treating these as proper aliases rather than new registers. This means that attempts to redefine the alias with the same "name" will provoke no warning and attempts to redefine the alias to something else will provoke the above mentioned warning. Tested make check-gas and no regressions. Ok to apply to trunk (and backport to 2.29 branch)? Regards Ramana
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-aarch64.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 6a23f21..0cefa16 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -6772,6 +6772,7 @@ aarch64_canonicalize_symbol_name (char *name)
also have mixed-case names. */
#define REGDEF(s,n,t) { #s, n, REG_TYPE_##t, TRUE }
+#define REGDEF_ALIAS(s, n, t) { #s, n, REG_TYPE_##t, FALSE}
#define REGNUM(p,n,t) REGDEF(p##n, n, t)
#define REGSET16(p,t) \
REGNUM(p, 0,t), REGNUM(p, 1,t), REGNUM(p, 2,t), REGNUM(p, 3,t), \
@@ -6793,17 +6794,16 @@ static const reg_entry reg_names[] = {
REGSET31 (x, R_64), REGSET31 (X, R_64),
REGSET31 (w, R_32), REGSET31 (W, R_32),
+ REGDEF_ALIAS (ip0, 16, R_64), REGDEF_ALIAS (IP0, 16, R_64),
+ REGDEF_ALIAS (ip1, 17, R_64), REGDEF_ALIAS (IP1, 16, R_64),
+ REGDEF_ALIAS (fp, 29, R_64), REGDEF_ALIAS (FP, 29, R_64),
+ REGDEF_ALIAS (lr, 30, R_64), REGDEF_ALIAS (LR, 30, R_64),
REGDEF (wsp, 31, SP_32), REGDEF (WSP, 31, SP_32),
REGDEF (sp, 31, SP_64), REGDEF (SP, 31, SP_64),
REGDEF (wzr, 31, Z_32), REGDEF (WZR, 31, Z_32),
REGDEF (xzr, 31, Z_64), REGDEF (XZR, 31, Z_64),
- REGDEF (ip0, 16, R_64), REGDEF (IP0, 16, R_64),
- REGDEF (ip1, 17, R_64), REGDEF (IP1, 17, R_64),
- REGDEF (fp, 29, R_64), REGDEF (FP, 29, R_64),
- REGDEF (lr, 30, R_64), REGDEF (LR, 30, R_64),
-
/* Floating-point single precision registers. */
REGSET (s, FP_S), REGSET (S, FP_S),
@@ -6830,6 +6830,7 @@ static const reg_entry reg_names[] = {
};
#undef REGDEF
+#undef REGDEF_ALIAS
#undef REGNUM
#undef REGSET16
#undef REGSET31