summaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-01-15 20:34:11 +0000
committerH.J. Lu <hjl.tools@gmail.com>2013-01-15 20:34:11 +0000
commitaf89796ad5e8a8782a9494ebb1a7376c9bd44ca6 (patch)
treeedf901dc5577ce893ee1862206892c3beadb5868 /gas/config
parent1e5364517958c0d6000a11df1a6255937f4364eb (diff)
downloadbinutils-gdb-af89796ad5e8a8782a9494ebb1a7376c9bd44ca6.tar.gz
Increment length by 1 if the relocation token is removed
gas/ PR gas/15019 * config/tc-i386.c (lex_got): Increment length by 1 if the relocation token is removed. gas/testsuite/ PR gas/15019 * gas/i386/reloc32.s: Add tests for "xtrn@got -/+ 4". * gas/i386/reloc64.s: Likewise. * gas/i386/ilp32/reloc64.s: Likewise. * gas/i386/reloc32.d: Updated. * gas/i386/reloc64.d: Likewise. * gas/i386/ilp32/reloc64.d: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 56c06005fe2..641af39a15c 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -6783,8 +6783,6 @@ lex_got (enum bfd_reloc_code_real *rel,
char *tmpbuf, *past_reloc;
*rel = gotrel[j].rel[object_64bit];
- if (adjust)
- *adjust = len;
if (types)
{
@@ -6819,6 +6817,12 @@ lex_got (enum bfd_reloc_code_real *rel,
/* Replace the relocation token with ' ', so that
errors like foo@GOTOFF1 will be detected. */
tmpbuf[first++] = ' ';
+ else
+ /* Increment length by 1 if the relocation token is
+ removed. */
+ len++;
+ if (adjust)
+ *adjust = len;
memcpy (tmpbuf + first, past_reloc, second);
tmpbuf[first + second] = '\0';
return tmpbuf;