This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Another MIPS multigot patch


Daniel Jacobowitz <drow@false.org> writes:
>> > Do you expect the proposed assertion to succeed now?
>> 
>> Yeah, I just wasn't sure whether it was worth keeping in the final version.
>> If you think it is, I suggest we move it outside the switch statement.
>> It isn't really specific to GOT_PAGE relocations.
>
> I would prefer that.

Been looking further into this assertion thing, and I think it's
already covered by:

    static bfd_vma
    mips_elf_global_got_index [...]
    {
      [...]
      BFD_ASSERT (h->dynindx >= global_got_dynindx);
      [...]
    }

If you remove the dynindx check from check_relocs() without applying
the rest of the patch, this assertion triggers for your test case and
for the reduced version below.

I don't think it's worth adding the attachment to dejagnu since (a) the
current sources pass it anyway and (b) we can use the existing elf-rel-got*
tests to make sure that locally-binding symbols use page entries.  As below.

> I've just finished a build.  Everything came out OK, and the assertion
> never triggered.  Will you commit the patch?

Can do if it's approved.  As expected, some changes are needed to the
ld testsuite.  In elf-rel-got-*.d:

  - We now use page entries to access dg1.
  - The GOT entries are in a different (but legitimate) order.
  - The large-offset bits need updating after Maciej's macro changes.
  - We need a "#pass" at the end since the object contains other
    sections too, e.g. .pdr.

The last two are also needed for *-xgot.  I didn't update the SGI
versions of these tests since there are lots of other problems with them.
Another day...

OK to install?

Richard



2004-02-17  Daniel Jacobowitz  <drow@mvista.com>
            Richard Sandiford  <rsandifo@redhat.com>

bfd/
	* elfxx-mips.c (mips_elf_calculate_relocation): Use
	_bfd_elf_symbol_refs_local_p to decide whether to decay
	a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend.
	(_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE
	relocs if the symbol wasn't defined by a regular object file.
	Don't check the symbol's dynindx.

ld/testsuite/
	* ld-mips/elf/elf-rel-xgot-{n32,n64-linux}.d: Update after 2004-02-02
	changes to the way large constants are added.
	* ld-mips/elf/elf-rel-got-{n32,n64-linux}.d: Likewise.  Adjust order
	of GOT entries after today's change to the handling of GOT_PAGE
	relocations.

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.89
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.89 elfxx-mips.c
--- bfd/elfxx-mips.c	9 Feb 2004 08:04:00 -0000	1.89
+++ bfd/elfxx-mips.c	17 Feb 2004 08:56:06 -0000
@@ -3261,12 +3261,9 @@ mips_elf_calculate_relocation (bfd *abfd
     {
     case R_MIPS_GOT_PAGE:
     case R_MIPS_GOT_OFST:
-      /* If this symbol got a global GOT entry, we have to decay
-	 GOT_PAGE/GOT_OFST to GOT_DISP/addend.  */
-      local_p = local_p || ! h
-	|| (h->root.dynindx
-	    < mips_elf_get_global_gotsym_index (elf_hash_table (info)
-						->dynobj));
+      /* We need to decay to GOT_DISP/addend if the symbol doesn't
+	 bind locally.  */
+      local_p = local_p || _bfd_elf_symbol_refs_local_p (&h->root, info, 1);
       if (local_p || r_type == R_MIPS_GOT_OFST)
 	break;
       /* Fall through.  */
@@ -5384,25 +5381,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
 		hmips = (struct mips_elf_link_hash_entry *)
 		  hmips->root.root.u.i.link;
 
-	      if ((hmips->root.root.type == bfd_link_hash_defined
-		   || hmips->root.root.type == bfd_link_hash_defweak)
-		  && hmips->root.root.u.def.section
+	      if ((hmips->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
 		  && ! (info->shared && ! info->symbolic
 			&& ! (hmips->root.elf_link_hash_flags
-			      & ELF_LINK_FORCED_LOCAL))
-		  /* If we've encountered any other relocation
-		     referencing the symbol, we'll have marked it as
-		     dynamic, and, even though we might be able to get
-		     rid of the GOT entry should we know for sure all
-		     previous relocations were GOT_PAGE ones, at this
-		     point we can't tell, so just keep using the
-		     symbol as dynamic.  This is very important in the
-		     multi-got case, since we don't decide whether to
-		     decay GOT_PAGE to GOT_DISP on a per-GOT basis: if
-		     the symbol is dynamic, we'll need a GOT entry for
-		     every GOT in which the symbol is referenced with
-		     a GOT_PAGE relocation.  */
-		  && hmips->root.dynindx == -1)
+			      & ELF_LINK_FORCED_LOCAL)))
 		break;
 	    }
 	  /* Fall through.  */
Index: ld/testsuite/ld-mips-elf/elf-rel-got-n32.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/elf-rel-got-n32.d,v
retrieving revision 1.2
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 elf-rel-got-n32.d
--- ld/testsuite/ld-mips-elf/elf-rel-got-n32.d	21 Jun 2003 21:38:04 -0000	1.2
+++ ld/testsuite/ld-mips-elf/elf-rel-got-n32.d	17 Feb 2004 08:56:06 -0000
@@ -13,8 +13,8 @@ 100000a0:	8f858064 	lw	a1,-32668\(gp\)
 100000a4:	8f858064 	lw	a1,-32668\(gp\)
 100000a8:	24a5000c 	addiu	a1,a1,12
 100000ac:	8f858064 	lw	a1,-32668\(gp\)
-100000b0:	3c010002 	lui	at,0x2
-100000b4:	2421e240 	addiu	at,at,-7616
+100000b0:	3c010001 	lui	at,0x1
+100000b4:	3421e240 	ori	at,at,0xe240
 100000b8:	00a12821 	addu	a1,a1,at
 100000bc:	8f858064 	lw	a1,-32668\(gp\)
 100000c0:	00b12821 	addu	a1,a1,s1
@@ -22,26 +22,26 @@ 100000c4:	8f858064 	lw	a1,-32668\(gp\)
 100000c8:	24a5000c 	addiu	a1,a1,12
 100000cc:	00b12821 	addu	a1,a1,s1
 100000d0:	8f858064 	lw	a1,-32668\(gp\)
-100000d4:	3c010002 	lui	at,0x2
-100000d8:	2421e240 	addiu	at,at,-7616
+100000d4:	3c010001 	lui	at,0x1
+100000d8:	3421e240 	ori	at,at,0xe240
 100000dc:	00a12821 	addu	a1,a1,at
 100000e0:	00b12821 	addu	a1,a1,s1
-100000e4:	8f858064 	lw	a1,-32668\(gp\)
-100000e8:	8ca50000 	lw	a1,0\(a1\)
-100000ec:	8f858064 	lw	a1,-32668\(gp\)
-100000f0:	8ca5000c 	lw	a1,12\(a1\)
-100000f4:	8f858064 	lw	a1,-32668\(gp\)
+100000e4:	8f858018 	lw	a1,-32744\(gp\)
+100000e8:	8ca5050c 	lw	a1,1292\(a1\)
+100000ec:	8f858018 	lw	a1,-32744\(gp\)
+100000f0:	8ca50518 	lw	a1,1304\(a1\)
+100000f4:	8f858018 	lw	a1,-32744\(gp\)
 100000f8:	00b12821 	addu	a1,a1,s1
-100000fc:	8ca50000 	lw	a1,0\(a1\)
-10000100:	8f858064 	lw	a1,-32668\(gp\)
+100000fc:	8ca5050c 	lw	a1,1292\(a1\)
+10000100:	8f858018 	lw	a1,-32744\(gp\)
 10000104:	00b12821 	addu	a1,a1,s1
-10000108:	8ca5000c 	lw	a1,12\(a1\)
-1000010c:	8f818064 	lw	at,-32668\(gp\)
+10000108:	8ca50518 	lw	a1,1304\(a1\)
+1000010c:	8f818018 	lw	at,-32744\(gp\)
 10000110:	00250821 	addu	at,at,a1
-10000114:	8c250022 	lw	a1,34\(at\)
-10000118:	8f818064 	lw	at,-32668\(gp\)
+10000114:	8c25052e 	lw	a1,1326\(at\)
+10000118:	8f818018 	lw	at,-32744\(gp\)
 1000011c:	00250821 	addu	at,at,a1
-10000120:	ac250038 	sw	a1,56\(at\)
+10000120:	ac250544 	sw	a1,1348\(at\)
 10000124:	8f818064 	lw	at,-32668\(gp\)
 10000128:	88250000 	lwl	a1,0\(at\)
 1000012c:	98250003 	lwr	a1,3\(at\)
@@ -68,42 +68,42 @@ 1000017c:	24210038 	addiu	at,at,56
 10000180:	00250821 	addu	at,at,a1
 10000184:	a8250000 	swl	a1,0\(at\)
 10000188:	b8250003 	swr	a1,3\(at\)
-1000018c:	8f858018 	lw	a1,-32744\(gp\)
-10000190:	8f85801c 	lw	a1,-32740\(gp\)
-10000194:	8f858020 	lw	a1,-32736\(gp\)
-10000198:	8f858018 	lw	a1,-32744\(gp\)
+1000018c:	8f85801c 	lw	a1,-32740\(gp\)
+10000190:	8f858020 	lw	a1,-32736\(gp\)
+10000194:	8f858024 	lw	a1,-32732\(gp\)
+10000198:	8f85801c 	lw	a1,-32740\(gp\)
 1000019c:	00b12821 	addu	a1,a1,s1
-100001a0:	8f85801c 	lw	a1,-32740\(gp\)
+100001a0:	8f858020 	lw	a1,-32736\(gp\)
 100001a4:	00b12821 	addu	a1,a1,s1
-100001a8:	8f858020 	lw	a1,-32736\(gp\)
+100001a8:	8f858024 	lw	a1,-32732\(gp\)
 100001ac:	00b12821 	addu	a1,a1,s1
-100001b0:	8f858024 	lw	a1,-32732\(gp\)
+100001b0:	8f858018 	lw	a1,-32744\(gp\)
 100001b4:	8ca5050c 	lw	a1,1292\(a1\)
-100001b8:	8f858024 	lw	a1,-32732\(gp\)
+100001b8:	8f858018 	lw	a1,-32744\(gp\)
 100001bc:	8ca50518 	lw	a1,1304\(a1\)
-100001c0:	8f858024 	lw	a1,-32732\(gp\)
+100001c0:	8f858018 	lw	a1,-32744\(gp\)
 100001c4:	00b12821 	addu	a1,a1,s1
 100001c8:	8ca5050c 	lw	a1,1292\(a1\)
-100001cc:	8f858024 	lw	a1,-32732\(gp\)
+100001cc:	8f858018 	lw	a1,-32744\(gp\)
 100001d0:	00b12821 	addu	a1,a1,s1
 100001d4:	8ca50518 	lw	a1,1304\(a1\)
-100001d8:	8f818024 	lw	at,-32732\(gp\)
+100001d8:	8f818018 	lw	at,-32744\(gp\)
 100001dc:	00250821 	addu	at,at,a1
 100001e0:	8c25052e 	lw	a1,1326\(at\)
-100001e4:	8f818024 	lw	at,-32732\(gp\)
+100001e4:	8f818018 	lw	at,-32744\(gp\)
 100001e8:	00250821 	addu	at,at,a1
 100001ec:	ac250544 	sw	a1,1348\(at\)
-100001f0:	8f818018 	lw	at,-32744\(gp\)
+100001f0:	8f81801c 	lw	at,-32740\(gp\)
 100001f4:	88250000 	lwl	a1,0\(at\)
 100001f8:	98250003 	lwr	a1,3\(at\)
-100001fc:	8f81801c 	lw	at,-32740\(gp\)
+100001fc:	8f818020 	lw	at,-32736\(gp\)
 10000200:	88250000 	lwl	a1,0\(at\)
 10000204:	98250003 	lwr	a1,3\(at\)
-10000208:	8f818018 	lw	at,-32744\(gp\)
+10000208:	8f81801c 	lw	at,-32740\(gp\)
 1000020c:	00310821 	addu	at,at,s1
 10000210:	88250000 	lwl	a1,0\(at\)
 10000214:	98250003 	lwr	a1,3\(at\)
-10000218:	8f81801c 	lw	at,-32740\(gp\)
+10000218:	8f818020 	lw	at,-32736\(gp\)
 1000021c:	00310821 	addu	at,at,s1
 10000220:	88250000 	lwl	a1,0\(at\)
 10000224:	98250003 	lwr	a1,3\(at\)
@@ -129,8 +129,8 @@ 10000270:	8f858068 	lw	a1,-32664\(gp\)
 10000274:	8f858068 	lw	a1,-32664\(gp\)
 10000278:	24a5000c 	addiu	a1,a1,12
 1000027c:	8f858068 	lw	a1,-32664\(gp\)
-10000280:	3c010002 	lui	at,0x2
-10000284:	2421e240 	addiu	at,at,-7616
+10000280:	3c010001 	lui	at,0x1
+10000284:	3421e240 	ori	at,at,0xe240
 10000288:	00a12821 	addu	a1,a1,at
 1000028c:	8f858068 	lw	a1,-32664\(gp\)
 10000290:	00b12821 	addu	a1,a1,s1
@@ -138,26 +138,26 @@ 10000294:	8f858068 	lw	a1,-32664\(gp\)
 10000298:	24a5000c 	addiu	a1,a1,12
 1000029c:	00b12821 	addu	a1,a1,s1
 100002a0:	8f858068 	lw	a1,-32664\(gp\)
-100002a4:	3c010002 	lui	at,0x2
-100002a8:	2421e240 	addiu	at,at,-7616
+100002a4:	3c010001 	lui	at,0x1
+100002a8:	3421e240 	ori	at,at,0xe240
 100002ac:	00a12821 	addu	a1,a1,at
 100002b0:	00b12821 	addu	a1,a1,s1
-100002b4:	8f858068 	lw	a1,-32664\(gp\)
-100002b8:	8ca50000 	lw	a1,0\(a1\)
-100002bc:	8f858068 	lw	a1,-32664\(gp\)
-100002c0:	8ca5000c 	lw	a1,12\(a1\)
-100002c4:	8f858068 	lw	a1,-32664\(gp\)
+100002b4:	8f858018 	lw	a1,-32744\(gp\)
+100002b8:	8ca50584 	lw	a1,1412\(a1\)
+100002bc:	8f858018 	lw	a1,-32744\(gp\)
+100002c0:	8ca50590 	lw	a1,1424\(a1\)
+100002c4:	8f858018 	lw	a1,-32744\(gp\)
 100002c8:	00b12821 	addu	a1,a1,s1
-100002cc:	8ca50000 	lw	a1,0\(a1\)
-100002d0:	8f858068 	lw	a1,-32664\(gp\)
+100002cc:	8ca50584 	lw	a1,1412\(a1\)
+100002d0:	8f858018 	lw	a1,-32744\(gp\)
 100002d4:	00b12821 	addu	a1,a1,s1
-100002d8:	8ca5000c 	lw	a1,12\(a1\)
-100002dc:	8f818068 	lw	at,-32664\(gp\)
+100002d8:	8ca50590 	lw	a1,1424\(a1\)
+100002dc:	8f818018 	lw	at,-32744\(gp\)
 100002e0:	00250821 	addu	at,at,a1
-100002e4:	8c250022 	lw	a1,34\(at\)
-100002e8:	8f818068 	lw	at,-32664\(gp\)
+100002e4:	8c2505a6 	lw	a1,1446\(at\)
+100002e8:	8f818018 	lw	at,-32744\(gp\)
 100002ec:	00250821 	addu	at,at,a1
-100002f0:	ac250038 	sw	a1,56\(at\)
+100002f0:	ac2505bc 	sw	a1,1468\(at\)
 100002f4:	8f818068 	lw	at,-32664\(gp\)
 100002f8:	88250000 	lwl	a1,0\(at\)
 100002fc:	98250003 	lwr	a1,3\(at\)
@@ -193,20 +193,20 @@ 10000370:	8f858038 	lw	a1,-32712\(gp\)
 10000374:	00b12821 	addu	a1,a1,s1
 10000378:	8f85803c 	lw	a1,-32708\(gp\)
 1000037c:	00b12821 	addu	a1,a1,s1
-10000380:	8f858024 	lw	a1,-32732\(gp\)
+10000380:	8f858018 	lw	a1,-32744\(gp\)
 10000384:	8ca50584 	lw	a1,1412\(a1\)
-10000388:	8f858024 	lw	a1,-32732\(gp\)
+10000388:	8f858018 	lw	a1,-32744\(gp\)
 1000038c:	8ca50590 	lw	a1,1424\(a1\)
-10000390:	8f858024 	lw	a1,-32732\(gp\)
+10000390:	8f858018 	lw	a1,-32744\(gp\)
 10000394:	00b12821 	addu	a1,a1,s1
 10000398:	8ca50584 	lw	a1,1412\(a1\)
-1000039c:	8f858024 	lw	a1,-32732\(gp\)
+1000039c:	8f858018 	lw	a1,-32744\(gp\)
 100003a0:	00b12821 	addu	a1,a1,s1
 100003a4:	8ca50590 	lw	a1,1424\(a1\)
-100003a8:	8f818024 	lw	at,-32732\(gp\)
+100003a8:	8f818018 	lw	at,-32744\(gp\)
 100003ac:	00250821 	addu	at,at,a1
 100003b0:	8c2505a6 	lw	a1,1446\(at\)
-100003b4:	8f818024 	lw	at,-32732\(gp\)
+100003b4:	8f818018 	lw	at,-32744\(gp\)
 100003b8:	00250821 	addu	at,at,a1
 100003bc:	ac2505bc 	sw	a1,1468\(at\)
 100003c0:	8f818034 	lw	at,-32716\(gp\)
@@ -243,24 +243,24 @@ 10000438:	0320f809 	jalr	t9
 1000043c:	00000000 	nop
 10000440:	1000ff17 	b	100000a0 <fn>
 10000444:	8f858064 	lw	a1,-32668\(gp\)
-10000448:	8f858068 	lw	a1,-32664\(gp\)
+10000448:	8f858018 	lw	a1,-32744\(gp\)
 1000044c:	10000015 	b	100004a4 <fn2>
-10000450:	8ca50000 	lw	a1,0\(a1\)
+10000450:	8ca50584 	lw	a1,1412\(a1\)
 10000454:	1000ff12 	b	100000a0 <fn>
-10000458:	8f858018 	lw	a1,-32744\(gp\)
+10000458:	8f85801c 	lw	a1,-32740\(gp\)
 1000045c:	8f858038 	lw	a1,-32712\(gp\)
 10000460:	10000010 	b	100004a4 <fn2>
 10000464:	00000000 	nop
-10000468:	8f858020 	lw	a1,-32736\(gp\)
+10000468:	8f858024 	lw	a1,-32732\(gp\)
 1000046c:	1000ff0c 	b	100000a0 <fn>
 10000470:	00000000 	nop
-10000474:	8f858024 	lw	a1,-32732\(gp\)
+10000474:	8f858018 	lw	a1,-32744\(gp\)
 10000478:	1000000a 	b	100004a4 <fn2>
 1000047c:	8ca50584 	lw	a1,1412\(a1\)
-10000480:	8f858024 	lw	a1,-32732\(gp\)
+10000480:	8f858018 	lw	a1,-32744\(gp\)
 10000484:	1000ff06 	b	100000a0 <fn>
 10000488:	8ca50518 	lw	a1,1304\(a1\)
-1000048c:	8f818024 	lw	at,-32732\(gp\)
+1000048c:	8f818018 	lw	at,-32744\(gp\)
 10000490:	00250821 	addu	at,at,a1
 10000494:	10000003 	b	100004a4 <fn2>
 10000498:	8c2505a6 	lw	a1,1446\(at\)
@@ -292,10 +292,10 @@ Disassembly of section \.got:
 101005c0 <_GLOBAL_OFFSET_TABLE_>:
 101005c0:	00000000 	.*
 101005c4:	80000000 	.*
-101005c8:	1010050c 	.*
-101005cc:	10100518 	.*
-101005d0:	1011e74c 	.*
-101005d4:	10100000 	.*
+101005c8:	10100000 	.*
+101005cc:	1010050c 	.*
+101005d0:	10100518 	.*
+101005d4:	1011e74c 	.*
 101005d8:	1010052e 	.*
 101005dc:	10100544 	.*
 101005e0:	100000a0 	.*
@@ -311,3 +311,4 @@ 1010060c:	100000a0 	.*
 10100610:	100004a4 	.*
 10100614:	1010050c 	.*
 10100618:	10100584 	.*
+#pass
Index: ld/testsuite/ld-mips-elf/elf-rel-got-n64-linux.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/elf-rel-got-n64-linux.d,v
retrieving revision 1.1
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 elf-rel-got-n64-linux.d
--- ld/testsuite/ld-mips-elf/elf-rel-got-n64-linux.d	12 Jun 2003 17:07:14 -0000	1.1
+++ ld/testsuite/ld-mips-elf/elf-rel-got-n64-linux.d	17 Feb 2004 08:56:06 -0000
@@ -22,8 +22,8 @@ 00000001200000e0 <fn>:
    1200000e4:	df8580b8 	ld	a1,-32584\(gp\)
    1200000e8:	64a5000c 	daddiu	a1,a1,12
    1200000ec:	df8580b8 	ld	a1,-32584\(gp\)
-   1200000f0:	3c010002 	lui	at,0x2
-   1200000f4:	6421e240 	daddiu	at,at,-7616
+   1200000f0:	3c010001 	lui	at,0x1
+   1200000f4:	3421e240 	ori	at,at,0xe240
    1200000f8:	00a1282d 	daddu	a1,a1,at
    1200000fc:	df8580b8 	ld	a1,-32584\(gp\)
    120000100:	00b1282d 	daddu	a1,a1,s1
@@ -31,26 +31,26 @@ 00000001200000e0 <fn>:
    120000108:	64a5000c 	daddiu	a1,a1,12
    12000010c:	00b1282d 	daddu	a1,a1,s1
    120000110:	df8580b8 	ld	a1,-32584\(gp\)
-   120000114:	3c010002 	lui	at,0x2
-   120000118:	6421e240 	daddiu	at,at,-7616
+   120000114:	3c010001 	lui	at,0x1
+   120000118:	3421e240 	ori	at,at,0xe240
    12000011c:	00a1282d 	daddu	a1,a1,at
    120000120:	00b1282d 	daddu	a1,a1,s1
-   120000124:	df8580b8 	ld	a1,-32584\(gp\)
-   120000128:	dca50000 	ld	a1,0\(a1\)
-   12000012c:	df8580b8 	ld	a1,-32584\(gp\)
-   120000130:	dca5000c 	ld	a1,12\(a1\)
-   120000134:	df8580b8 	ld	a1,-32584\(gp\)
+   120000124:	df858020 	ld	a1,-32736\(gp\)
+   120000128:	dca5052c 	ld	a1,1324\(a1\)
+   12000012c:	df858020 	ld	a1,-32736\(gp\)
+   120000130:	dca50538 	ld	a1,1336\(a1\)
+   120000134:	df858020 	ld	a1,-32736\(gp\)
    120000138:	00b1282d 	daddu	a1,a1,s1
-   12000013c:	dca50000 	ld	a1,0\(a1\)
-   120000140:	df8580b8 	ld	a1,-32584\(gp\)
+   12000013c:	dca5052c 	ld	a1,1324\(a1\)
+   120000140:	df858020 	ld	a1,-32736\(gp\)
    120000144:	00b1282d 	daddu	a1,a1,s1
-   120000148:	dca5000c 	ld	a1,12\(a1\)
-   12000014c:	df8180b8 	ld	at,-32584\(gp\)
+   120000148:	dca50538 	ld	a1,1336\(a1\)
+   12000014c:	df818020 	ld	at,-32736\(gp\)
    120000150:	0025082d 	daddu	at,at,a1
-   120000154:	dc250022 	ld	a1,34\(at\)
-   120000158:	df8180b8 	ld	at,-32584\(gp\)
+   120000154:	dc25054e 	ld	a1,1358\(at\)
+   120000158:	df818020 	ld	at,-32736\(gp\)
    12000015c:	0025082d 	daddu	at,at,a1
-   120000160:	fc250038 	sd	a1,56\(at\)
+   120000160:	fc250564 	sd	a1,1380\(at\)
    120000164:	df8180b8 	ld	at,-32584\(gp\)
    120000168:	88250000 	lwl	a1,0\(at\)
    12000016c:	98250003 	lwr	a1,3\(at\)
@@ -77,42 +77,42 @@ 00000001200000e0 <fn>:
    1200001c0:	0025082d 	daddu	at,at,a1
    1200001c4:	a8250000 	swl	a1,0\(at\)
    1200001c8:	b8250003 	swr	a1,3\(at\)
-   1200001cc:	df858020 	ld	a1,-32736\(gp\)
-   1200001d0:	df858028 	ld	a1,-32728\(gp\)
-   1200001d4:	df858030 	ld	a1,-32720\(gp\)
-   1200001d8:	df858020 	ld	a1,-32736\(gp\)
+   1200001cc:	df858028 	ld	a1,-32728\(gp\)
+   1200001d0:	df858030 	ld	a1,-32720\(gp\)
+   1200001d4:	df858038 	ld	a1,-32712\(gp\)
+   1200001d8:	df858028 	ld	a1,-32728\(gp\)
    1200001dc:	00b1282d 	daddu	a1,a1,s1
-   1200001e0:	df858028 	ld	a1,-32728\(gp\)
+   1200001e0:	df858030 	ld	a1,-32720\(gp\)
    1200001e4:	00b1282d 	daddu	a1,a1,s1
-   1200001e8:	df858030 	ld	a1,-32720\(gp\)
+   1200001e8:	df858038 	ld	a1,-32712\(gp\)
    1200001ec:	00b1282d 	daddu	a1,a1,s1
-   1200001f0:	df858038 	ld	a1,-32712\(gp\)
+   1200001f0:	df858020 	ld	a1,-32736\(gp\)
    1200001f4:	dca5052c 	ld	a1,1324\(a1\)
-   1200001f8:	df858038 	ld	a1,-32712\(gp\)
+   1200001f8:	df858020 	ld	a1,-32736\(gp\)
    1200001fc:	dca50538 	ld	a1,1336\(a1\)
-   120000200:	df858038 	ld	a1,-32712\(gp\)
+   120000200:	df858020 	ld	a1,-32736\(gp\)
    120000204:	00b1282d 	daddu	a1,a1,s1
    120000208:	dca5052c 	ld	a1,1324\(a1\)
-   12000020c:	df858038 	ld	a1,-32712\(gp\)
+   12000020c:	df858020 	ld	a1,-32736\(gp\)
    120000210:	00b1282d 	daddu	a1,a1,s1
    120000214:	dca50538 	ld	a1,1336\(a1\)
-   120000218:	df818038 	ld	at,-32712\(gp\)
+   120000218:	df818020 	ld	at,-32736\(gp\)
    12000021c:	0025082d 	daddu	at,at,a1
    120000220:	dc25054e 	ld	a1,1358\(at\)
-   120000224:	df818038 	ld	at,-32712\(gp\)
+   120000224:	df818020 	ld	at,-32736\(gp\)
    120000228:	0025082d 	daddu	at,at,a1
    12000022c:	fc250564 	sd	a1,1380\(at\)
-   120000230:	df818020 	ld	at,-32736\(gp\)
+   120000230:	df818028 	ld	at,-32728\(gp\)
    120000234:	88250000 	lwl	a1,0\(at\)
    120000238:	98250003 	lwr	a1,3\(at\)
-   12000023c:	df818028 	ld	at,-32728\(gp\)
+   12000023c:	df818030 	ld	at,-32720\(gp\)
    120000240:	88250000 	lwl	a1,0\(at\)
    120000244:	98250003 	lwr	a1,3\(at\)
-   120000248:	df818020 	ld	at,-32736\(gp\)
+   120000248:	df818028 	ld	at,-32728\(gp\)
    12000024c:	0031082d 	daddu	at,at,s1
    120000250:	88250000 	lwl	a1,0\(at\)
    120000254:	98250003 	lwr	a1,3\(at\)
-   120000258:	df818028 	ld	at,-32728\(gp\)
+   120000258:	df818030 	ld	at,-32720\(gp\)
    12000025c:	0031082d 	daddu	at,at,s1
    120000260:	88250000 	lwl	a1,0\(at\)
    120000264:	98250003 	lwr	a1,3\(at\)
@@ -138,8 +138,8 @@ 00000001200000e0 <fn>:
    1200002b4:	df8580c0 	ld	a1,-32576\(gp\)
    1200002b8:	64a5000c 	daddiu	a1,a1,12
    1200002bc:	df8580c0 	ld	a1,-32576\(gp\)
-   1200002c0:	3c010002 	lui	at,0x2
-   1200002c4:	6421e240 	daddiu	at,at,-7616
+   1200002c0:	3c010001 	lui	at,0x1
+   1200002c4:	3421e240 	ori	at,at,0xe240
    1200002c8:	00a1282d 	daddu	a1,a1,at
    1200002cc:	df8580c0 	ld	a1,-32576\(gp\)
    1200002d0:	00b1282d 	daddu	a1,a1,s1
@@ -147,26 +147,26 @@ 00000001200000e0 <fn>:
    1200002d8:	64a5000c 	daddiu	a1,a1,12
    1200002dc:	00b1282d 	daddu	a1,a1,s1
    1200002e0:	df8580c0 	ld	a1,-32576\(gp\)
-   1200002e4:	3c010002 	lui	at,0x2
-   1200002e8:	6421e240 	daddiu	at,at,-7616
+   1200002e4:	3c010001 	lui	at,0x1
+   1200002e8:	3421e240 	ori	at,at,0xe240
    1200002ec:	00a1282d 	daddu	a1,a1,at
    1200002f0:	00b1282d 	daddu	a1,a1,s1
-   1200002f4:	df8580c0 	ld	a1,-32576\(gp\)
-   1200002f8:	dca50000 	ld	a1,0\(a1\)
-   1200002fc:	df8580c0 	ld	a1,-32576\(gp\)
-   120000300:	dca5000c 	ld	a1,12\(a1\)
-   120000304:	df8580c0 	ld	a1,-32576\(gp\)
+   1200002f4:	df858020 	ld	a1,-32736\(gp\)
+   1200002f8:	dca505a4 	ld	a1,1444\(a1\)
+   1200002fc:	df858020 	ld	a1,-32736\(gp\)
+   120000300:	dca505b0 	ld	a1,1456\(a1\)
+   120000304:	df858020 	ld	a1,-32736\(gp\)
    120000308:	00b1282d 	daddu	a1,a1,s1
-   12000030c:	dca50000 	ld	a1,0\(a1\)
-   120000310:	df8580c0 	ld	a1,-32576\(gp\)
+   12000030c:	dca505a4 	ld	a1,1444\(a1\)
+   120000310:	df858020 	ld	a1,-32736\(gp\)
    120000314:	00b1282d 	daddu	a1,a1,s1
-   120000318:	dca5000c 	ld	a1,12\(a1\)
-   12000031c:	df8180c0 	ld	at,-32576\(gp\)
+   120000318:	dca505b0 	ld	a1,1456\(a1\)
+   12000031c:	df818020 	ld	at,-32736\(gp\)
    120000320:	0025082d 	daddu	at,at,a1
-   120000324:	dc250022 	ld	a1,34\(at\)
-   120000328:	df8180c0 	ld	at,-32576\(gp\)
+   120000324:	dc2505c6 	ld	a1,1478\(at\)
+   120000328:	df818020 	ld	at,-32736\(gp\)
    12000032c:	0025082d 	daddu	at,at,a1
-   120000330:	fc250038 	sd	a1,56\(at\)
+   120000330:	fc2505dc 	sd	a1,1500\(at\)
    120000334:	df8180c0 	ld	at,-32576\(gp\)
    120000338:	88250000 	lwl	a1,0\(at\)
    12000033c:	98250003 	lwr	a1,3\(at\)
@@ -202,20 +202,20 @@ 00000001200000e0 <fn>:
    1200003b4:	00b1282d 	daddu	a1,a1,s1
    1200003b8:	df858068 	ld	a1,-32664\(gp\)
    1200003bc:	00b1282d 	daddu	a1,a1,s1
-   1200003c0:	df858038 	ld	a1,-32712\(gp\)
+   1200003c0:	df858020 	ld	a1,-32736\(gp\)
    1200003c4:	dca505a4 	ld	a1,1444\(a1\)
-   1200003c8:	df858038 	ld	a1,-32712\(gp\)
+   1200003c8:	df858020 	ld	a1,-32736\(gp\)
    1200003cc:	dca505b0 	ld	a1,1456\(a1\)
-   1200003d0:	df858038 	ld	a1,-32712\(gp\)
+   1200003d0:	df858020 	ld	a1,-32736\(gp\)
    1200003d4:	00b1282d 	daddu	a1,a1,s1
    1200003d8:	dca505a4 	ld	a1,1444\(a1\)
-   1200003dc:	df858038 	ld	a1,-32712\(gp\)
+   1200003dc:	df858020 	ld	a1,-32736\(gp\)
    1200003e0:	00b1282d 	daddu	a1,a1,s1
    1200003e4:	dca505b0 	ld	a1,1456\(a1\)
-   1200003e8:	df818038 	ld	at,-32712\(gp\)
+   1200003e8:	df818020 	ld	at,-32736\(gp\)
    1200003ec:	0025082d 	daddu	at,at,a1
    1200003f0:	dc2505c6 	ld	a1,1478\(at\)
-   1200003f4:	df818038 	ld	at,-32712\(gp\)
+   1200003f4:	df818020 	ld	at,-32736\(gp\)
    1200003f8:	0025082d 	daddu	at,at,a1
    1200003fc:	fc2505dc 	sd	a1,1500\(at\)
    120000400:	df818058 	ld	at,-32680\(gp\)
@@ -252,24 +252,24 @@ 00000001200000e0 <fn>:
    12000047c:	00000000 	nop
    120000480:	1000ff17 	b	1200000e0 <fn>
    120000484:	df8580b8 	ld	a1,-32584\(gp\)
-   120000488:	df8580c0 	ld	a1,-32576\(gp\)
+   120000488:	df858020 	ld	a1,-32736\(gp\)
    12000048c:	10000015 	b	1200004e4 <fn2>
-   120000490:	dca50000 	ld	a1,0\(a1\)
+   120000490:	dca505a4 	ld	a1,1444\(a1\)
    120000494:	1000ff12 	b	1200000e0 <fn>
-   120000498:	df858020 	ld	a1,-32736\(gp\)
+   120000498:	df858028 	ld	a1,-32728\(gp\)
    12000049c:	df858060 	ld	a1,-32672\(gp\)
    1200004a0:	10000010 	b	1200004e4 <fn2>
    1200004a4:	00000000 	nop
-   1200004a8:	df858030 	ld	a1,-32720\(gp\)
+   1200004a8:	df858038 	ld	a1,-32712\(gp\)
    1200004ac:	1000ff0c 	b	1200000e0 <fn>
    1200004b0:	00000000 	nop
-   1200004b4:	df858038 	ld	a1,-32712\(gp\)
+   1200004b4:	df858020 	ld	a1,-32736\(gp\)
    1200004b8:	1000000a 	b	1200004e4 <fn2>
    1200004bc:	dca505a4 	ld	a1,1444\(a1\)
-   1200004c0:	df858038 	ld	a1,-32712\(gp\)
+   1200004c0:	df858020 	ld	a1,-32736\(gp\)
    1200004c4:	1000ff06 	b	1200000e0 <fn>
    1200004c8:	dca50538 	ld	a1,1336\(a1\)
-   1200004cc:	df818038 	ld	at,-32712\(gp\)
+   1200004cc:	df818020 	ld	at,-32736\(gp\)
    1200004d0:	0025082d 	daddu	at,at,a1
    1200004d4:	10000003 	b	1200004e4 <fn2>
    1200004d8:	dc2505c6 	ld	a1,1478\(at\)
@@ -296,13 +296,13 @@ 00000001201005e0 <_GLOBAL_OFFSET_TABLE_>
 	\.\.\.
    1201005ec:	80000000 	.*
    1201005f0:	00000001 	.*
-   1201005f4:	2010052c 	.*
+   1201005f4:	20100000 	.*
    1201005f8:	00000001 	.*
-   1201005fc:	20100538 	.*
+   1201005fc:	2010052c 	.*
    120100600:	00000001 	.*
-   120100604:	2011e76c 	.*
+   120100604:	20100538 	.*
    120100608:	00000001 	.*
-   12010060c:	20100000 	.*
+   12010060c:	2011e76c 	.*
    120100610:	00000001 	.*
    120100614:	2010054e 	.*
    120100618:	00000001 	.*
@@ -330,3 +330,4 @@ 00000001201005e0 <_GLOBAL_OFFSET_TABLE_>
    12010068c:	2010052c 	.*
    120100690:	00000001 	.*
    120100694:	201005a4 	.*
+#pass
Index: ld/testsuite/ld-mips-elf/elf-rel-xgot-n32.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/elf-rel-xgot-n32.d,v
retrieving revision 1.3
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.3 elf-rel-xgot-n32.d
--- ld/testsuite/ld-mips-elf/elf-rel-xgot-n32.d	7 Dec 2003 21:49:09 -0000	1.3
+++ ld/testsuite/ld-mips-elf/elf-rel-xgot-n32.d	17 Feb 2004 08:56:06 -0000
@@ -19,8 +19,8 @@ 100000b8:	24a5000c 	addiu	a1,a1,12
 100000bc:	3c050000 	lui	a1,0x0
 100000c0:	00bc2821 	addu	a1,a1,gp
 100000c4:	8ca58034 	lw	a1,-32716\(a1\)
-100000c8:	3c010002 	lui	at,0x2
-100000cc:	2421e240 	addiu	at,at,-7616
+100000c8:	3c010001 	lui	at,0x1
+100000cc:	3421e240 	ori	at,at,0xe240
 100000d0:	00a12821 	addu	a1,a1,at
 100000d4:	3c050000 	lui	a1,0x0
 100000d8:	00bc2821 	addu	a1,a1,gp
@@ -34,8 +34,8 @@ 100000f4:	00b12821 	addu	a1,a1,s1
 100000f8:	3c050000 	lui	a1,0x0
 100000fc:	00bc2821 	addu	a1,a1,gp
 10000100:	8ca58034 	lw	a1,-32716\(a1\)
-10000104:	3c010002 	lui	at,0x2
-10000108:	2421e240 	addiu	at,at,-7616
+10000104:	3c010001 	lui	at,0x1
+10000108:	3421e240 	ori	at,at,0xe240
 1000010c:	00a12821 	addu	a1,a1,at
 10000110:	00b12821 	addu	a1,a1,s1
 10000114:	3c050000 	lui	a1,0x0
@@ -192,8 +192,8 @@ 1000036c:	24a5000c 	addiu	a1,a1,12
 10000370:	3c050000 	lui	a1,0x0
 10000374:	00bc2821 	addu	a1,a1,gp
 10000378:	8ca58038 	lw	a1,-32712\(a1\)
-1000037c:	3c010002 	lui	at,0x2
-10000380:	2421e240 	addiu	at,at,-7616
+1000037c:	3c010001 	lui	at,0x1
+10000380:	3421e240 	ori	at,at,0xe240
 10000384:	00a12821 	addu	a1,a1,at
 10000388:	3c050000 	lui	a1,0x0
 1000038c:	00bc2821 	addu	a1,a1,gp
@@ -207,8 +207,8 @@ 100003a8:	00b12821 	addu	a1,a1,s1
 100003ac:	3c050000 	lui	a1,0x0
 100003b0:	00bc2821 	addu	a1,a1,gp
 100003b4:	8ca58038 	lw	a1,-32712\(a1\)
-100003b8:	3c010002 	lui	at,0x2
-100003bc:	2421e240 	addiu	at,at,-7616
+100003b8:	3c010001 	lui	at,0x1
+100003bc:	3421e240 	ori	at,at,0xe240
 100003c0:	00a12821 	addu	a1,a1,at
 100003c4:	00b12821 	addu	a1,a1,s1
 100003c8:	3c050000 	lui	a1,0x0
@@ -425,3 +425,4 @@ 101007cc:	100000a0 	.*
 101007d0:	100006a0 	.*
 101007d4:	101006fc 	.*
 101007d8:	10100774 	.*
+#pass
Index: ld/testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.d,v
retrieving revision 1.2
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 elf-rel-xgot-n64-linux.d
--- ld/testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.d	7 Dec 2003 21:49:09 -0000	1.2
+++ ld/testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.d	17 Feb 2004 08:56:06 -0000
@@ -28,8 +28,8 @@ 00000001200000e0 <fn>:
    1200000fc:	3c050000 	lui	a1,0x0
    120000100:	00bc282d 	daddu	a1,a1,gp
    120000104:	dca58058 	ld	a1,-32680\(a1\)
-   120000108:	3c010002 	lui	at,0x2
-   12000010c:	6421e240 	daddiu	at,at,-7616
+   120000108:	3c010001 	lui	at,0x1
+   12000010c:	3421e240 	ori	at,at,0xe240
    120000110:	00a1282d 	daddu	a1,a1,at
    120000114:	3c050000 	lui	a1,0x0
    120000118:	00bc282d 	daddu	a1,a1,gp
@@ -43,8 +43,8 @@ 00000001200000e0 <fn>:
    120000138:	3c050000 	lui	a1,0x0
    12000013c:	00bc282d 	daddu	a1,a1,gp
    120000140:	dca58058 	ld	a1,-32680\(a1\)
-   120000144:	3c010002 	lui	at,0x2
-   120000148:	6421e240 	daddiu	at,at,-7616
+   120000144:	3c010001 	lui	at,0x1
+   120000148:	3421e240 	ori	at,at,0xe240
    12000014c:	00a1282d 	daddu	a1,a1,at
    120000150:	00b1282d 	daddu	a1,a1,s1
    120000154:	3c050000 	lui	a1,0x0
@@ -201,8 +201,8 @@ 00000001200000e0 <fn>:
    1200003b0:	3c050000 	lui	a1,0x0
    1200003b4:	00bc282d 	daddu	a1,a1,gp
    1200003b8:	dca58060 	ld	a1,-32672\(a1\)
-   1200003bc:	3c010002 	lui	at,0x2
-   1200003c0:	6421e240 	daddiu	at,at,-7616
+   1200003bc:	3c010001 	lui	at,0x1
+   1200003c0:	3421e240 	ori	at,at,0xe240
    1200003c4:	00a1282d 	daddu	a1,a1,at
    1200003c8:	3c050000 	lui	a1,0x0
    1200003cc:	00bc282d 	daddu	a1,a1,gp
@@ -216,8 +216,8 @@ 00000001200000e0 <fn>:
    1200003ec:	3c050000 	lui	a1,0x0
    1200003f0:	00bc282d 	daddu	a1,a1,gp
    1200003f4:	dca58060 	ld	a1,-32672\(a1\)
-   1200003f8:	3c010002 	lui	at,0x2
-   1200003fc:	6421e240 	daddiu	at,at,-7616
+   1200003f8:	3c010001 	lui	at,0x1
+   1200003fc:	3421e240 	ori	at,at,0xe240
    120000400:	00a1282d 	daddu	a1,a1,at
    120000404:	00b1282d 	daddu	a1,a1,s1
    120000408:	3c050000 	lui	a1,0x0
@@ -434,3 +434,4 @@ 00000001201007d0 <_GLOBAL_OFFSET_TABLE_>
    12010081c:	2010071c 	.*
    120100820:	00000001 	.*
    120100824:	20100794 	.*
+#pass


cat <<EOF > a.s
	.globl	__start
	.globl	gs
__start:
gs:
ls:
	lw	\$4,%got_page(gs)(\$gp)
	addiu	\$4,\$4,%got_ofst(gs)
	lw	\$4,%got_page(us)(\$gp)
	addiu	\$4,\$4,%got_ofst(us)
	lw	\$4,%got_page(ls)(\$gp)
	addiu	\$4,\$4,%got_ofst(ls)
	.data
	.word	us2
EOF
cat <<EOF > b.s
	.globl	us
	.globl	us2
	.globl	gs
us:
us2:
gs:
ls:
	lw	\$4,%got_page(gs)(\$gp)
	addiu	\$4,\$4,%got_ofst(gs)
	lw	\$4,%got_page(us)(\$gp)
	addiu	\$4,\$4,%got_ofst(us)
	lw	\$4,%got_page(ls)(\$gp)
	addiu	\$4,\$4,%got_ofst(ls)
EOF
./gas/as-new a.s -o a.o
./gas/as-new b.s -o b.o
./ld/ld-new b.o -o b.so -shared
./ld/ld-new b.so a.o -o a.x
./ld/ld-new a.o b.so -o b.x

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]