From: H.J. Lu Date: Wed, 28 Aug 2024 11:30:08 +0000 (-0700) Subject: x86: Report invalid TLS operator X-Git-Tag: gdb-16-branchpoint~1054 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=903ae636569889dbfab81356f81831041bc03a8f;p=thirdparty%2Fbinutils-gdb.git x86: Report invalid TLS operator 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 --- diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 25cfe0bdb8d..ca87afd10a1 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -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; } diff --git a/gas/testsuite/gas/i386/inval-tls.l b/gas/testsuite/gas/i386/inval-tls.l index 5e4b82c2119..98f7a29f1ab 100644 --- a/gas/testsuite/gas/i386/inval-tls.l +++ b/gas/testsuite/gas/i386/inval-tls.l @@ -1,2 +1,2 @@ .*: Assembler messages: -.*:3: Error: GOTNTPOFF relocation cannot be used with `kmovd' +.*:3: Error: @GOTNTPOFF operator cannot be used with `kmovd' diff --git a/gas/testsuite/gas/i386/x86-64-inval-tls.l b/gas/testsuite/gas/i386/x86-64-inval-tls.l index f31082cee73..da8ac19f869 100644 --- a/gas/testsuite/gas/i386/x86-64-inval-tls.l +++ b/gas/testsuite/gas/i386/x86-64-inval-tls.l @@ -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'