patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-gotpc.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-gotpc.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,372 @@
     1.4 +2002-08-03  Jakub Jelinek  <jakub@redhat.com>
     1.5 +
     1.6 +	* config/tc-i386.c (output_insn): Save frag_now and frag_now_fix ()
     1.7 +	at start of insn, pass it to output_disp and output_imm.
     1.8 +	(output_disp): Added arguments.  If _GLOBAL_OFFSET_TABLE_ is seen
     1.9 +	in displacement for R_386_32 reloc, use R_386_GOTPC and compute
    1.10 +	properly addend.
    1.11 +	(output_imm): Added arguments.  Compute properly addend for
    1.12 +	R_386_GOTPC.
    1.13 +	(md_apply_fix3): Remove R_386_GOTPC handling.
    1.14 +	* testsuite/gas/i386/gotpc.s: New.
    1.15 +	* testsuite/gas/i386/gotpc.d: New.
    1.16 +	* testsuite/gas/i386/i386.exp: Add gotpc test.
    1.17 +
    1.18 +--- binutils/gas/config/tc-i386.c.jj	2002-07-18 11:35:39.000000000 +0200
    1.19 ++++ binutils/gas/config/tc-i386.c	2002-08-02 21:13:18.000000000 +0200
    1.20 +@@ -104,8 +104,10 @@ static void output_insn PARAMS ((void));
    1.21 + static void output_branch PARAMS ((void));
    1.22 + static void output_jump PARAMS ((void));
    1.23 + static void output_interseg_jump PARAMS ((void));
    1.24 +-static void output_imm PARAMS ((void));
    1.25 +-static void output_disp PARAMS ((void));
    1.26 ++static void output_imm PARAMS ((fragS *insn_start_frag,
    1.27 ++				offsetT insn_start_off));
    1.28 ++static void output_disp PARAMS ((fragS *insn_start_frag,
    1.29 ++				 offsetT insn_start_off));
    1.30 + #ifndef I386COFF
    1.31 + static void s_bss PARAMS ((int));
    1.32 + #endif
    1.33 +@@ -3101,14 +3103,21 @@ output_interseg_jump ()
    1.34 +   md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2);
    1.35 + }
    1.36 + 
    1.37 ++
    1.38 + static void
    1.39 + output_insn ()
    1.40 + {
    1.41 ++  fragS *insn_start_frag;
    1.42 ++  offsetT insn_start_off;
    1.43 ++
    1.44 +   /* Tie dwarf2 debug info to the address at the start of the insn.
    1.45 +      We can't do this after the insn has been output as the current
    1.46 +      frag may have been closed off.  eg. by frag_var.  */
    1.47 +   dwarf2_emit_insn (0);
    1.48 + 
    1.49 ++  insn_start_frag = frag_now;
    1.50 ++  insn_start_off = frag_now_fix ();
    1.51 ++
    1.52 +   /* Output jumps.  */
    1.53 +   if (i.tm.opcode_modifier & Jump)
    1.54 +     output_branch ();
    1.55 +@@ -3179,10 +3188,10 @@ output_insn ()
    1.56 + 	}
    1.57 + 
    1.58 +       if (i.disp_operands)
    1.59 +-	output_disp ();
    1.60 ++	output_disp (insn_start_frag, insn_start_off);
    1.61 + 
    1.62 +       if (i.imm_operands)
    1.63 +-	output_imm ();
    1.64 ++	output_imm (insn_start_frag, insn_start_off);
    1.65 +     }
    1.66 + 
    1.67 + #ifdef DEBUG386
    1.68 +@@ -3194,7 +3203,9 @@ output_insn ()
    1.69 + }
    1.70 + 
    1.71 + static void
    1.72 +-output_disp ()
    1.73 ++output_disp (insn_start_frag, insn_start_off)
    1.74 ++    fragS *insn_start_frag;
    1.75 ++    offsetT insn_start_off;
    1.76 + {
    1.77 +   char *p;
    1.78 +   unsigned int n;
    1.79 +@@ -3224,6 +3235,7 @@ output_disp ()
    1.80 + 	    }
    1.81 + 	  else
    1.82 + 	    {
    1.83 ++	      RELOC_ENUM reloc_type;
    1.84 + 	      int size = 4;
    1.85 + 	      int sign = 0;
    1.86 + 	      int pcrel = (i.flags[n] & Operand_PCrel) != 0;
    1.87 +@@ -3266,16 +3278,50 @@ output_disp ()
    1.88 + 		}
    1.89 + 
    1.90 + 	      p = frag_more (size);
    1.91 ++	      reloc_type = reloc (size, pcrel, sign, i.reloc[n]);
    1.92 ++#ifdef BFD_ASSEMBLER
    1.93 ++	      if (reloc_type == BFD_RELOC_32
    1.94 ++		  && GOT_symbol
    1.95 ++		  && GOT_symbol == i.op[n].disps->X_add_symbol
    1.96 ++		  && (i.op[n].disps->X_op == O_symbol
    1.97 ++		      || (i.op[n].disps->X_op == O_add
    1.98 ++			  && ((symbol_get_value_expression
    1.99 ++			       (i.op[n].disps->X_op_symbol)->X_op)
   1.100 ++			      == O_subtract))))
   1.101 ++		{
   1.102 ++		  offsetT add;
   1.103 ++
   1.104 ++		  if (insn_start_frag == frag_now)
   1.105 ++		    add = (p - frag_now->fr_literal) - insn_start_off;
   1.106 ++		  else
   1.107 ++		    {
   1.108 ++		      fragS *fr;
   1.109 ++
   1.110 ++		      add = insn_start_frag->fr_fix - insn_start_off;
   1.111 ++		      for (fr = insn_start_frag->fr_next;
   1.112 ++			   fr && fr != frag_now; fr = fr->fr_next)
   1.113 ++			add += fr->fr_fix;
   1.114 ++		      add += p - frag_now->fr_literal;
   1.115 ++		    }
   1.116 ++
   1.117 ++		  /* We don't support dynamic linking on x86-64 yet.  */
   1.118 ++		  if (flag_code == CODE_64BIT)
   1.119 ++		    abort ();
   1.120 ++		  reloc_type = BFD_RELOC_386_GOTPC;
   1.121 ++		  i.op[n].disps->X_add_number += add;
   1.122 ++		}
   1.123 ++#endif
   1.124 + 	      fix_new_exp (frag_now, p - frag_now->fr_literal, size,
   1.125 +-			   i.op[n].disps, pcrel,
   1.126 +-			   reloc (size, pcrel, sign, i.reloc[n]));
   1.127 ++			   i.op[n].disps, pcrel, reloc_type);
   1.128 + 	    }
   1.129 + 	}
   1.130 +     }
   1.131 + }
   1.132 + 
   1.133 + static void
   1.134 +-output_imm ()
   1.135 ++output_imm (insn_start_frag, insn_start_off)
   1.136 ++    fragS *insn_start_frag;
   1.137 ++    offsetT insn_start_off;
   1.138 + {
   1.139 +   char *p;
   1.140 +   unsigned int n;
   1.141 +@@ -3328,6 +3374,48 @@ output_imm ()
   1.142 + 	      p = frag_more (size);
   1.143 + 	      reloc_type = reloc (size, 0, sign, i.reloc[n]);
   1.144 + #ifdef BFD_ASSEMBLER
   1.145 ++	      /*   This is tough to explain.  We end up with this one if we
   1.146 ++	       * have operands that look like
   1.147 ++	       * "_GLOBAL_OFFSET_TABLE_+[.-.L284]".  The goal here is to
   1.148 ++	       * obtain the absolute address of the GOT, and it is strongly
   1.149 ++	       * preferable from a performance point of view to avoid using
   1.150 ++	       * a runtime relocation for this.  The actual sequence of
   1.151 ++	       * instructions often look something like:
   1.152 ++	       *
   1.153 ++	       *	call	.L66
   1.154 ++	       * .L66:
   1.155 ++	       *	popl	%ebx
   1.156 ++	       *	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L66],%ebx
   1.157 ++	       *
   1.158 ++	       *   The call and pop essentially return the absolute address
   1.159 ++	       * of the label .L66 and store it in %ebx.  The linker itself
   1.160 ++	       * will ultimately change the first operand of the addl so
   1.161 ++	       * that %ebx points to the GOT, but to keep things simple, the
   1.162 ++	       * .o file must have this operand set so that it generates not
   1.163 ++	       * the absolute address of .L66, but the absolute address of
   1.164 ++	       * itself.  This allows the linker itself simply treat a GOTPC
   1.165 ++	       * relocation as asking for a pcrel offset to the GOT to be
   1.166 ++	       * added in, and the addend of the relocation is stored in the
   1.167 ++	       * operand field for the instruction itself.
   1.168 ++	       *
   1.169 ++	       *   Our job here is to fix the operand so that it would add
   1.170 ++	       * the correct offset so that %ebx would point to itself.  The
   1.171 ++	       * thing that is tricky is that .-.L66 will point to the
   1.172 ++	       * beginning of the instruction, so we need to further modify
   1.173 ++	       * the operand so that it will point to itself.  There are
   1.174 ++	       * other cases where you have something like:
   1.175 ++	       *
   1.176 ++	       *	.long	$_GLOBAL_OFFSET_TABLE_+[.-.L66]
   1.177 ++	       *
   1.178 ++	       * and here no correction would be required.  Internally in
   1.179 ++	       * the assembler we treat operands of this form as not being
   1.180 ++	       * pcrel since the '.' is explicitly mentioned, and I wonder
   1.181 ++	       * whether it would simplify matters to do it this way.  Who
   1.182 ++	       * knows.  In earlier versions of the PIC patches, the
   1.183 ++	       * pcrel_adjust field was used to store the correction, but
   1.184 ++	       * since the expression is not pcrel, I felt it would be
   1.185 ++	       * confusing to do it this way.  */
   1.186 ++
   1.187 + 	      if (reloc_type == BFD_RELOC_32
   1.188 + 		  && GOT_symbol
   1.189 + 		  && GOT_symbol == i.op[n].imms->X_add_symbol
   1.190 +@@ -3337,11 +3425,26 @@ output_imm ()
   1.191 + 			       (i.op[n].imms->X_op_symbol)->X_op)
   1.192 + 			      == O_subtract))))
   1.193 + 		{
   1.194 ++		  offsetT add;
   1.195 ++
   1.196 ++		  if (insn_start_frag == frag_now)
   1.197 ++		    add = (p - frag_now->fr_literal) - insn_start_off;
   1.198 ++		  else
   1.199 ++		    {
   1.200 ++		      fragS *fr;
   1.201 ++
   1.202 ++		      add = insn_start_frag->fr_fix - insn_start_off;
   1.203 ++		      for (fr = insn_start_frag->fr_next;
   1.204 ++			   fr && fr != frag_now; fr = fr->fr_next)
   1.205 ++			add += fr->fr_fix;
   1.206 ++		      add += p - frag_now->fr_literal;
   1.207 ++		    }
   1.208 ++
   1.209 + 		  /* We don't support dynamic linking on x86-64 yet.  */
   1.210 + 		  if (flag_code == CODE_64BIT)
   1.211 + 		    abort ();
   1.212 + 		  reloc_type = BFD_RELOC_386_GOTPC;
   1.213 +-		  i.op[n].imms->X_add_number += 3;
   1.214 ++		  i.op[n].imms->X_add_number += add;
   1.215 + 		}
   1.216 + #endif
   1.217 + 	      fix_new_exp (frag_now, p - frag_now->fr_literal, size,
   1.218 +@@ -4542,48 +4645,6 @@ md_apply_fix3 (fixP, valP, seg)
   1.219 + 	   runtime we merely add the offset to the actual PLT entry.  */
   1.220 + 	value = -4;
   1.221 + 	break;
   1.222 +-      case BFD_RELOC_386_GOTPC:
   1.223 +-
   1.224 +-/*   This is tough to explain.  We end up with this one if we have
   1.225 +- * operands that look like "_GLOBAL_OFFSET_TABLE_+[.-.L284]".  The goal
   1.226 +- * here is to obtain the absolute address of the GOT, and it is strongly
   1.227 +- * preferable from a performance point of view to avoid using a runtime
   1.228 +- * relocation for this.  The actual sequence of instructions often look
   1.229 +- * something like:
   1.230 +- *
   1.231 +- *	call	.L66
   1.232 +- * .L66:
   1.233 +- *	popl	%ebx
   1.234 +- *	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L66],%ebx
   1.235 +- *
   1.236 +- *   The call and pop essentially return the absolute address of
   1.237 +- * the label .L66 and store it in %ebx.  The linker itself will
   1.238 +- * ultimately change the first operand of the addl so that %ebx points to
   1.239 +- * the GOT, but to keep things simple, the .o file must have this operand
   1.240 +- * set so that it generates not the absolute address of .L66, but the
   1.241 +- * absolute address of itself.  This allows the linker itself simply
   1.242 +- * treat a GOTPC relocation as asking for a pcrel offset to the GOT to be
   1.243 +- * added in, and the addend of the relocation is stored in the operand
   1.244 +- * field for the instruction itself.
   1.245 +- *
   1.246 +- *   Our job here is to fix the operand so that it would add the correct
   1.247 +- * offset so that %ebx would point to itself.  The thing that is tricky is
   1.248 +- * that .-.L66 will point to the beginning of the instruction, so we need
   1.249 +- * to further modify the operand so that it will point to itself.
   1.250 +- * There are other cases where you have something like:
   1.251 +- *
   1.252 +- *	.long	$_GLOBAL_OFFSET_TABLE_+[.-.L66]
   1.253 +- *
   1.254 +- * and here no correction would be required.  Internally in the assembler
   1.255 +- * we treat operands of this form as not being pcrel since the '.' is
   1.256 +- * explicitly mentioned, and I wonder whether it would simplify matters
   1.257 +- * to do it this way.  Who knows.  In earlier versions of the PIC patches,
   1.258 +- * the pcrel_adjust field was used to store the correction, but since the
   1.259 +- * expression is not pcrel, I felt it would be confusing to do it this
   1.260 +- * way.  */
   1.261 +-
   1.262 +-	value -= 1;
   1.263 +-	break;
   1.264 +       case BFD_RELOC_386_GOT32:
   1.265 +       case BFD_RELOC_386_TLS_GD:
   1.266 +       case BFD_RELOC_386_TLS_LDM:
   1.267 +--- binutils/gas/testsuite/gas/i386/gotpc.s.jj	2002-08-02 21:17:57.000000000 +0200
   1.268 ++++ binutils/gas/testsuite/gas/i386/gotpc.s	2002-08-03 22:55:47.000000000 +0200
   1.269 +@@ -0,0 +1,40 @@
   1.270 ++	.text
   1.271 ++test:
   1.272 ++	addl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
   1.273 ++	addl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
   1.274 ++	addl $_GLOBAL_OFFSET_TABLE_, %eax
   1.275 ++	addl $_GLOBAL_OFFSET_TABLE_, %ebx
   1.276 ++	leal _GLOBAL_OFFSET_TABLE+[.-test](%eax), %ebx
   1.277 ++	leal _GLOBAL_OFFSET_TABLE+[.-test](%ebx), %eax
   1.278 ++	leal _GLOBAL_OFFSET_TABLE+[.-test](%eax), %eax
   1.279 ++	leal _GLOBAL_OFFSET_TABLE+[.-test](%ebx), %ebx
   1.280 ++	subl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
   1.281 ++	subl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
   1.282 ++	subl $_GLOBAL_OFFSET_TABLE_, %eax
   1.283 ++	subl $_GLOBAL_OFFSET_TABLE_, %ebx
   1.284 ++	orl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
   1.285 ++	orl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
   1.286 ++	orl $_GLOBAL_OFFSET_TABLE_, %eax
   1.287 ++	orl $_GLOBAL_OFFSET_TABLE_, %ebx
   1.288 ++	movl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
   1.289 ++	movl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
   1.290 ++	movl $_GLOBAL_OFFSET_TABLE_, %eax
   1.291 ++	movl $_GLOBAL_OFFSET_TABLE_, %ebx
   1.292 ++	movl $_GLOBAL_OFFSET_TABLE_+[.-test], foo
   1.293 ++	movl $_GLOBAL_OFFSET_TABLE_+[.-test], %gs:foo
   1.294 ++	gs; movl $_GLOBAL_OFFSET_TABLE_+[.-test], foo
   1.295 ++	movl $_GLOBAL_OFFSET_TABLE_+[.-test], _GLOBAL_OFFSET_TABLE_
   1.296 ++	movl _GLOBAL_OFFSET_TABLE_+[.-test], %eax
   1.297 ++	movl _GLOBAL_OFFSET_TABLE_+[.-test], %ebx
   1.298 ++	movl %eax, _GLOBAL_OFFSET_TABLE_+[.-test]
   1.299 ++	movl %ebx, _GLOBAL_OFFSET_TABLE_+[.-test]
   1.300 ++	movl %eax, %gs:_GLOBAL_OFFSET_TABLE_+[.-test]
   1.301 ++	movl %ebx, %gs:_GLOBAL_OFFSET_TABLE_+[.-test]
   1.302 ++	gs; movl %eax, _GLOBAL_OFFSET_TABLE_+[.-test]
   1.303 ++	gs; movl %ebx, _GLOBAL_OFFSET_TABLE_+[.-test]
   1.304 ++	leal _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %eax
   1.305 ++	leal _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %ebx
   1.306 ++	movl _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %eax
   1.307 ++	movl _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %ebx
   1.308 ++	.long _GLOBAL_OFFSET_TABLE_+[.-test]
   1.309 ++	.long _GLOBAL_OFFSET_TABLE_@GOTOFF
   1.310 +--- binutils/gas/testsuite/gas/i386/gotpc.d.jj	2002-08-02 21:18:43.000000000 +0200
   1.311 ++++ binutils/gas/testsuite/gas/i386/gotpc.d	2002-08-03 23:05:43.000000000 +0200
   1.312 +@@ -0,0 +1,52 @@
   1.313 ++#objdump: -drw
   1.314 ++#name: i386 gotpc
   1.315 ++
   1.316 ++.*: +file format .*
   1.317 ++
   1.318 ++Disassembly of section .text:
   1.319 ++
   1.320 ++0+000 <test>:
   1.321 ++   0:	05 01 00 00 00 [ 	]*add    \$0x1,%eax	1: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.322 ++   5:	81 c3 07 00 00 00 [ 	]*add    \$0x7,%ebx	7: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.323 ++   b:	05 01 00 00 00 [ 	]*add    \$0x1,%eax	c: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.324 ++  10:	81 c3 02 00 00 00 [ 	]*add    \$0x2,%ebx	12: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.325 ++  16:	8d 98 16 00 00 00 [ 	]*lea    0x16\(%eax\),%ebx	18: (R_386_)?(dir)?32	_GLOBAL_OFFSET_TABLE
   1.326 ++  1c:	8d 83 1c 00 00 00 [ 	]*lea    0x1c\(%ebx\),%eax	1e: (R_386_)?(dir)?32	_GLOBAL_OFFSET_TABLE
   1.327 ++  22:	8d 80 22 00 00 00 [ 	]*lea    0x22\(%eax\),%eax	24: (R_386_)?(dir)?32	_GLOBAL_OFFSET_TABLE
   1.328 ++  28:	8d 9b 28 00 00 00 [ 	]*lea    0x28\(%ebx\),%ebx	2a: (R_386_)?(dir)?32	_GLOBAL_OFFSET_TABLE
   1.329 ++  2e:	2d 2f 00 00 00 [ 	]*sub    \$0x2f,%eax	2f: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.330 ++  33:	81 eb 35 00 00 00 [ 	]*sub    \$0x35,%ebx	35: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.331 ++  39:	2d 01 00 00 00 [ 	]*sub    \$0x1,%eax	3a: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.332 ++  3e:	81 eb 02 00 00 00 [ 	]*sub    \$0x2,%ebx	40: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.333 ++  44:	0d 45 00 00 00 [ 	]*or     \$0x45,%eax	45: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.334 ++  49:	81 cb 4b 00 00 00 [ 	]*or     \$0x4b,%ebx	4b: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.335 ++  4f:	0d 01 00 00 00 [ 	]*or     \$0x1,%eax	50: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.336 ++  54:	81 cb 02 00 00 00 [ 	]*or     \$0x2,%ebx	56: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.337 ++  5a:	b8 5b 00 00 00 [ 	]*mov    \$0x5b,%eax	5b: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.338 ++  5f:	bb 60 00 00 00 [ 	]*mov    \$0x60,%ebx	60: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.339 ++  64:	b8 01 00 00 00 [ 	]*mov    \$0x1,%eax	65: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.340 ++  69:	bb 01 00 00 00 [ 	]*mov    \$0x1,%ebx	6a: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.341 ++  6e:	c7 05 00 00 00 00 74 00 00 00 [ 	]*movl   \$0x74,0x0	70: (R_386_)?(dir)?32	foo
   1.342 ++[ 	]*74: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.343 ++  78:	65 c7 05 00 00 00 00 7f 00 00 00 [ 	]*movl   \$0x7f,%gs:0x0	7b: (R_386_)?(dir)?32	foo
   1.344 ++[ 	]*7f: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.345 ++  83:	65 c7 05 00 00 00 00 8a 00 00 00 [ 	]*movl   \$0x8a,%gs:0x0	86: (R_386_)?(dir)?32	foo
   1.346 ++[ 	]*8a: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.347 ++  8e:	c7 05 02 00 00 00 94 00 00 00 [ 	]*movl   \$0x94,0x2	90: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.348 ++[ 	]*94: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.349 ++  98:	a1 99 00 00 00 [ 	]*mov    0x99,%eax	99: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.350 ++  9d:	8b 1d 9f 00 00 00 [ 	]*mov    0x9f,%ebx	9f: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.351 ++  a3:	a3 a4 00 00 00 [ 	]*mov    %eax,0xa4	a4: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.352 ++  a8:	89 1d aa 00 00 00 [ 	]*mov    %ebx,0xaa	aa: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.353 ++  ae:	65 a3 b0 00 00 00 [ 	]*mov    %eax,%gs:0xb0	b0: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.354 ++  b4:	65 89 1d b7 00 00 00 [ 	]*mov    %ebx,%gs:0xb7	b7: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.355 ++  bb:	65 a3 bd 00 00 00 [ 	]*mov    %eax,%gs:0xbd	bd: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.356 ++  c1:	65 89 1d c4 00 00 00 [ 	]*mov    %ebx,%gs:0xc4	c4: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.357 ++  c8:	8d 83 00 00 00 00 [ 	]*lea    0x0\(%ebx\),%eax	ca: (R_386_)?GOTOFF	_GLOBAL_OFFSET_TABLE_
   1.358 ++  ce:	8d 9b 00 00 00 00 [ 	]*lea    0x0\(%ebx\),%ebx	d0: (R_386_)?GOTOFF	_GLOBAL_OFFSET_TABLE_
   1.359 ++  d4:	8b 83 00 00 00 00 [ 	]*mov    0x0\(%ebx\),%eax	d6: (R_386_)?GOTOFF	_GLOBAL_OFFSET_TABLE_
   1.360 ++  da:	8b 9b 00 00 00 00 [ 	]*mov    0x0\(%ebx\),%ebx	dc: (R_386_)?GOTOFF	_GLOBAL_OFFSET_TABLE_
   1.361 ++  e0:	e0 00 [ 	]*loopne e2 <test\+0xe2>	e0: (R_386_)?GOTPC	_GLOBAL_OFFSET_TABLE_
   1.362 ++  e2:	00 00 [ 	]*add    %al,\(%eax\)
   1.363 ++  e4:	00 00 [ 	]*add    %al,\(%eax\)	e4: (R_386_)?GOTOFF	_GLOBAL_OFFSET_TABLE_
   1.364 ++	...
   1.365 +--- binutils/gas/testsuite/gas/i386/i386.exp.jj	2002-07-18 11:35:39.000000000 +0200
   1.366 ++++ binutils/gas/testsuite/gas/i386/i386.exp	2002-08-02 21:57:46.000000000 +0200
   1.367 +@@ -53,6 +53,7 @@ if [expr ([istarget "i*86-*-*"] ||  [ist
   1.368 +     run_dump_test "jump"
   1.369 +     run_dump_test "ssemmx2"
   1.370 +     run_dump_test "sse2"
   1.371 ++    run_dump_test "gotpc"
   1.372 + 
   1.373 +     # PIC is only supported on ELF targets.
   1.374 +     if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"] )
   1.375 +