]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Report invalid TLS operator
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Aug 2024 11:30:08 +0000 (04:30 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Aug 2024 12:01:34 +0000 (05:01 -0700)
Report invalid TLS operator, instead of relocation.

PR gas/28595
* config/tc-i386.c (gotrel): Replace int with unsigned int.
(i386_assemble): Report invalid TLS operator.
* testsuite/gas/i386/inval-tls.l: updated.
* testsuite/gas/i386/x86-64-inval-tls.l: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gas/config/tc-i386.c
gas/testsuite/gas/i386/inval-tls.l
gas/testsuite/gas/i386/x86-64-inval-tls.l

index 25cfe0bdb8d5db581a5ab8c97d874f724cb2d30b..ca87afd10a1a65c9aa5597e7297d13a1701892cd 100644 (file)
@@ -1297,7 +1297,7 @@ static htab_t reg_hash;
 static const struct
 {
   const char *str;
-  int len;
+  unsigned int len;
   const enum bfd_reloc_code_real rel[2];
   const i386_operand_type types64;
   bool need_GOT_symbol;
@@ -6678,7 +6678,7 @@ i386_assemble (char *line)
              {
                if (gotrel[k].rel[object_64bit] == i.reloc[j])
                  {
-                   as_bad (_("%s relocation cannot be used with `%s'"),
+                   as_bad (_("@%s operator cannot be used with `%s'"),
                          gotrel[k].str, insn_name (&i.tm));
                    return;
                  }
index 5e4b82c211902321d811d59129b4f7ca62a811ca..98f7a29f1abd768bfdf993c58adfedc22dc488c5 100644 (file)
@@ -1,2 +1,2 @@
 .*: Assembler messages:
-.*:3: Error: GOTNTPOFF relocation cannot be used with `kmovd'
+.*:3: Error: @GOTNTPOFF operator cannot be used with `kmovd'
index f31082cee738e51ea3192472610b5ea0867769e5..da8ac19f8699f2dbe16d62727e89417d11dee3c3 100644 (file)
@@ -1,3 +1,3 @@
 .*: Assembler messages:
-.*:3: Error: GOTTPOFF relocation cannot be used with `kmovq'
-.*:4: Error: TLSLD relocation cannot be used with `kmovq'
+.*:3: Error: @GOTTPOFF operator cannot be used with `kmovq'
+.*:4: Error: @TLSLD operator cannot be used with `kmovq'