+2013-01-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/15019
+       * config/tc-i386.c (lex_got): Increment length by 1 if the
+       relocation token is removed.
+
 2013-01-15  Nick Clifton  <nickc@redhat.com>
 
        * config/tc-v850.c (md_assemble): Allow signed values for
 2013-01-11  Sean Keys  <skeys@ipdatasys.com>
 
        * config/tc-xgate.c (md_begin): Fix mistake made when going from
-        git to cvs.
+       git to cvs.
 
 2013-01-10  Peter Bergner <bergner@vnet.ibm.com>
 
 2013-01-10  Sean Keys  <skeys@ipdatasys.com>
 
        * config/tc-xgate.c (md_begin): Fix the printing of opcodes so
-        that the assember exits after the opcodes have been printed.
+       that the assember exits after the opcodes have been printed.
 
 2013-01-10  H.J. Lu  <hongjiu.lu@intel.com>
 
 
              char *tmpbuf, *past_reloc;
 
              *rel = gotrel[j].rel[object_64bit];
-             if (adjust)
-               *adjust = len;
 
              if (types)
                {
                /* 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;
 
+2013-01-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       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.
+
 2013-01-15  Nick Clifton  <nickc@redhat.com>
 
        * gas/v850/basic.exp: Allow for variations in reloc names.
 
 .*[    ]+R_X86_64_64[  ]+xtrn
 .*[    ]+R_X86_64_64[  ]+xtrn\+0x7fffffff
 .*[    ]+R_X86_64_64[  ]+xtrn\-0x80000000
+.*[    ]+R_X86_64_GOT32[       ]+xtrn-0x4
+.*[    ]+R_X86_64_GOT32[       ]+xtrn\+0x4
 
        .quad   xtrn
        .quad   xtrn + 0x7fffffff
        .quad   xtrn - 0x80000000
+       .long   xtrn@got - 4
+       .long   xtrn@got + 4
 
 .*[    ]+R_386_PC16[   ]+xtrn
 .*[    ]+R_386_8[      ]+xtrn
 .*[    ]+R_386_PC8[    ]+xtrn
+#...
+.*[    ]+R_386_GOT32[  ]+xtrn
+.*[    ]+R_386_GOT32[  ]+xtrn
 
 bad    .byte   xtrn@dtpoff
 bad    .byte   xtrn@ntpoff
 bad    .byte   xtrn@tpoff
+       .long   xtrn@got + 4
+       .long   xtrn@got - 4
 
 .*[    ]+R_X86_64_PC16[        ]+xtrn
 .*[    ]+R_X86_64_8[   ]+xtrn
 .*[    ]+R_X86_64_PC8[         ]+xtrn
+.*[    ]+R_X86_64_GOT32[       ]+xtrn-0x4
+.*[    ]+R_X86_64_GOT32[       ]+xtrn\+0x4
 
 
        .text
        mov     xtrn@tpoff (%rbx), %eax
+
+       .data
+       .long   xtrn@got - 4
+       .long   xtrn@got + 4