[lld] r245491 - [Mips] Use 'or' for move instead of [d]addu in PLT entries

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 13:20:10 PDT 2015


Author: atanasyan
Date: Wed Aug 19 15:20:10 2015
New Revision: 245491

URL: http://llvm.org/viewvc/llvm-project?rev=245491&view=rev
Log:
[Mips] Use 'or' for move instead of [d]addu in PLT entries

Patch by Simon Dardis.

Differential Revision: http://reviews.llvm.org/D12103

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
    lld/trunk/test/elf/Mips/la25-stub-npic-shared.test
    lld/trunk/test/elf/Mips/plt-entry-mixed-1.test
    lld/trunk/test/elf/Mips/plt-entry-mixed-2.test
    lld/trunk/test/elf/Mips/plt-entry-mixed-4.test
    lld/trunk/test/elf/Mips/plt-entry-r6-be.test
    lld/trunk/test/elf/Mips/plt-entry-r6.test
    lld/trunk/test/elf/Mips/plt-header-be.test
    lld/trunk/test/elf/Mips/plt-header-mixed.test
    lld/trunk/test/elf/Mips/plt-header.test
    lld/trunk/test/elf/Mips/rel-dynamic-01.test
    lld/trunk/test/elf/Mips/rel-dynamic-03.test

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Wed Aug 19 15:20:10 2015
@@ -43,7 +43,7 @@ static const uint8_t mipsBePlt0AtomConte
   0x8f, 0x99, 0x00, 0x00, // lw    $25, %lo(&GOTPLT[0])($28)
   0x27, 0x9c, 0x00, 0x00, // addiu $28, $28, %lo(&GOTPLT[0])
   0x03, 0x1c, 0xc0, 0x23, // subu  $24, $24, $28
-  0x03, 0xe0, 0x78, 0x21, // move  $15, $31
+  0x03, 0xe0, 0x78, 0x25, // move  $15, $31
   0x00, 0x18, 0xc0, 0x82, // srl   $24, $24, 2
   0x03, 0x20, 0xf8, 0x09, // jalr  $25
   0x27, 0x18, 0xff, 0xfe  // subu  $24, $24, 2
@@ -55,7 +55,7 @@ static const uint8_t mipsLePlt0AtomConte
   0x00, 0x00, 0x99, 0x8f, // lw    $25, %lo(&GOTPLT[0])($28)
   0x00, 0x00, 0x9c, 0x27, // addiu $28, $28, %lo(&GOTPLT[0])
   0x23, 0xc0, 0x1c, 0x03, // subu  $24, $24, $28
-  0x21, 0x78, 0xe0, 0x03, // move  $15, $31
+  0x25, 0x78, 0xe0, 0x03, // move  $15, $31
   0x82, 0xc0, 0x18, 0x00, // srl   $24, $24, 2
   0x09, 0xf8, 0x20, 0x03, // jalr  $25
   0xfe, 0xff, 0x18, 0x27  // subu  $24, $24, 2

Modified: lld/trunk/test/elf/Mips/la25-stub-npic-shared.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub-npic-shared.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub-npic-shared.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub-npic-shared.test Wed Aug 19 15:20:10 2015
@@ -11,7 +11,7 @@
 
 # CHECK:      Contents of section .plt:
 # CHECK-NEXT:  400190 40001c3c 0020998f 00209c27 23c01c03
-# CHECK-NEXT:  4001a0 2178e003 82c01800 09f82003 feff1827
+# CHECK-NEXT:  4001a0 2578e003 82c01800 09f82003 feff1827
 # CHECK-NEXT:  4001b0 40000f3c 0820f98d 08002003 0820f825
 #                     ^ PLT.T1
 # CHECK-NEXT:  4001c0 00799307 22ff0000 9945020f

Modified: lld/trunk/test/elf/Mips/plt-entry-mixed-1.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-entry-mixed-1.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-entry-mixed-1.test (original)
+++ lld/trunk/test/elf/Mips/plt-entry-mixed-1.test Wed Aug 19 15:20:10 2015
@@ -21,7 +21,7 @@
 # CHECK-NEXT:   400174:   00 20 99 8f   lw      $25, 8192($gp)
 # CHECK-NEXT:   400178:   00 20 9c 27   addiu   $gp, $gp, 8192
 # CHECK-NEXT:   40017c:   23 c0 1c 03   subu    $24, $24, $gp
-# CHECK-NEXT:   400180:   21 78 e0 03   move    $15, $ra
+# CHECK-NEXT:   400180:   25 78 e0 03   move    $15, $ra
 # CHECK-NEXT:   400184:   82 c0 18 00   srl     $24, $24, 2
 # CHECK-NEXT:   400188:   09 f8 20 03   jalr    $25
 # CHECK-NEXT:   40018c:   fe ff 18 27   addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/plt-entry-mixed-2.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-entry-mixed-2.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-entry-mixed-2.test (original)
+++ lld/trunk/test/elf/Mips/plt-entry-mixed-2.test Wed Aug 19 15:20:10 2015
@@ -18,10 +18,10 @@
 #                to support microMIPS instruction encoding.
 
 # CHECK: Contents of section .plt:
-# CHECK-NEXT:  400170 40001c3c 0020998f 00209c27 23c01c03  @..<. ... .'#...
-# CHECK-NEXT:  400180 2178e003 82c01800 09f82003 feff1827  !x........ ....'
-# CHECK-NEXT:  400190 40000f3c 0820f98d 08002003 0820f825  @..<. .... .. .%
-# CHECK-NEXT:  4001a0 00799a07 22ff0000 9945020f           .y.."....E..
+# CHECK-NEXT:  400170 40001c3c 0020998f 00209c27 23c01c03
+# CHECK-NEXT:  400180 2578e003 82c01800 09f82003 feff1827
+# CHECK-NEXT:  400190 40000f3c 0820f98d 08002003 0820f825
+# CHECK-NEXT:  4001a0 00799a07 22ff0000 9945020f
 
 # so.o
 ---

Modified: lld/trunk/test/elf/Mips/plt-entry-mixed-4.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-entry-mixed-4.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-entry-mixed-4.test (original)
+++ lld/trunk/test/elf/Mips/plt-entry-mixed-4.test Wed Aug 19 15:20:10 2015
@@ -18,9 +18,9 @@
 #                to support microMIPS instruction encoding.
 
 # CHECK: Contents of section .plt:
-# CHECK-NEXT:  400170 40001c3c 0020998f 00209c27 23c01c03  @..<. ... .'#...
-# CHECK-NEXT:  400180 2178e003 82c01800 09f82003 feff1827  !x........ ....'
-# CHECK-NEXT:  400190 40000f3c 0820f98d 08002003 0820f825  @..<. .... .. .%
+# CHECK-NEXT:  400170 40001c3c 0020998f 00209c27 23c01c03
+# CHECK-NEXT:  400180 2578e003 82c01800 09f82003 feff1827
+# CHECK-NEXT:  400190 40000f3c 0820f98d 08002003 0820f825
 
 # so.o
 ---

Modified: lld/trunk/test/elf/Mips/plt-entry-r6-be.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-entry-r6-be.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-entry-r6-be.test (original)
+++ lld/trunk/test/elf/Mips/plt-entry-r6-be.test Wed Aug 19 15:20:10 2015
@@ -17,7 +17,7 @@
 # CHECK-NEXT:   400164:   8f 99 20 00   lw      $25, 8192($gp)
 # CHECK-NEXT:   400168:   27 9c 20 00   addiu   $gp, $gp, 8192
 # CHECK-NEXT:   40016c:   03 1c c0 23   subu    $24, $24, $gp
-# CHECK-NEXT:   400170:   03 e0 78 21   move    $15, $ra
+# CHECK-NEXT:   400170:   03 e0 78 25   move    $15, $ra
 # CHECK-NEXT:   400174:   00 18 c0 82   srl     $24, $24, 2
 # CHECK-NEXT:   400178:   03 20 f8 09   jalr    $25
 # CHECK-NEXT:   40017c:   27 18 ff fe   addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/plt-entry-r6.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-entry-r6.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-entry-r6.test (original)
+++ lld/trunk/test/elf/Mips/plt-entry-r6.test Wed Aug 19 15:20:10 2015
@@ -17,7 +17,7 @@
 # CHECK-NEXT:   400164:   00 20 99 8f   lw      $25, 8192($gp)
 # CHECK-NEXT:   400168:   00 20 9c 27   addiu   $gp, $gp, 8192
 # CHECK-NEXT:   40016c:   23 c0 1c 03   subu    $24, $24, $gp
-# CHECK-NEXT:   400170:   21 78 e0 03   move    $15, $ra
+# CHECK-NEXT:   400170:   25 78 e0 03   move    $15, $ra
 # CHECK-NEXT:   400174:   82 c0 18 00   srl     $24, $24, 2
 # CHECK-NEXT:   400178:   09 f8 20 03   jalr    $25
 # CHECK-NEXT:   40017c:   fe ff 18 27   addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/plt-header-be.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-header-be.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-header-be.test (original)
+++ lld/trunk/test/elf/Mips/plt-header-be.test Wed Aug 19 15:20:10 2015
@@ -17,7 +17,7 @@
 # CHECK-NEXT:  400164:   8f 99 20 00     lw      $25, 8192($gp)
 # CHECK-NEXT:  400168:   27 9c 20 00     addiu   $gp, $gp, 8192
 # CHECK-NEXT:  40016c:   03 1c c0 23     subu    $24, $24, $gp
-# CHECK-NEXT:  400170:   03 e0 78 21     move     $15, $ra
+# CHECK-NEXT:  400170:   03 e0 78 25     move    $15, $ra
 # CHECK-NEXT:  400174:   00 18 c0 82     srl     $24, $24, 2
 # CHECK-NEXT:  400178:   03 20 f8 09     jalr    $25
 # CHECK-NEXT:  40017c:   27 18 ff fe     addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/plt-header-mixed.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-header-mixed.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-header-mixed.test (original)
+++ lld/trunk/test/elf/Mips/plt-header-mixed.test Wed Aug 19 15:20:10 2015
@@ -20,7 +20,7 @@
 # DIS-NEXT:   400174:  00 20 99 8f   lw      $25, 8192($gp)
 # DIS-NEXT:   400178:  00 20 9c 27   addiu   $gp, $gp, 8192
 # DIS-NEXT:   40017c:  23 c0 1c 03   subu    $24, $24, $gp
-# DIS-NEXT:   400180:  21 78 e0 03   move     $15, $ra
+# DIS-NEXT:   400180:  25 78 e0 03   move    $15, $ra
 # DIS-NEXT:   400184:  82 c0 18 00   srl     $24, $24, 2
 # DIS-NEXT:   400188:  09 f8 20 03   jalr    $25
 # DIS-NEXT:   40018c:  fe ff 18 27   addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/plt-header.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-header.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-header.test (original)
+++ lld/trunk/test/elf/Mips/plt-header.test Wed Aug 19 15:20:10 2015
@@ -19,7 +19,7 @@
 # EXE-NEXT:   400164:  00 20 99 8f  lw      $25, 8192($gp)
 # EXE-NEXT:   400168:  00 20 9c 27  addiu   $gp, $gp, 8192
 # EXE-NEXT:   40016c:  23 c0 1c 03  subu    $24, $24, $gp
-# EXE-NEXT:   400170:  21 78 e0 03  move    $15, $ra
+# EXE-NEXT:   400170:  25 78 e0 03  move    $15, $ra
 # EXE-NEXT:   400174:  82 c0 18 00  srl     $24, $24, 2
 # EXE-NEXT:   400178:  09 f8 20 03  jalr    $25
 # EXE-NEXT:   40017c:  fe ff 18 27  addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/rel-dynamic-01.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-dynamic-01.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-dynamic-01.test (original)
+++ lld/trunk/test/elf/Mips/rel-dynamic-01.test Wed Aug 19 15:20:10 2015
@@ -23,7 +23,7 @@
 # PLT-NEXT:   4001f4:  00 20 99 8f  lw      $25, 8192($gp)
 # PLT-NEXT:   4001f8:  00 20 9c 27  addiu   $gp, $gp, 8192
 # PLT-NEXT:   4001fc:  23 c0 1c 03  subu    $24, $24, $gp
-# PLT-NEXT:   400200:  21 78 e0 03  move    $15, $ra
+# PLT-NEXT:   400200:  25 78 e0 03  move    $15, $ra
 # PLT-NEXT:   400204:  82 c0 18 00  srl     $24, $24, 2
 # PLT-NEXT:   400208:  09 f8 20 03  jalr    $25
 # PLT-NEXT:   40020c:  fe ff 18 27  addiu   $24, $24, -2

Modified: lld/trunk/test/elf/Mips/rel-dynamic-03.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/rel-dynamic-03.test?rev=245491&r1=245490&r2=245491&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/rel-dynamic-03.test (original)
+++ lld/trunk/test/elf/Mips/rel-dynamic-03.test Wed Aug 19 15:20:10 2015
@@ -24,7 +24,7 @@
 # PLT-NEXT:   400164:  00 20 99 8f  lw      $25, 8192($gp)
 # PLT-NEXT:   400168:  00 20 9c 27  addiu   $gp, $gp, 8192
 # PLT-NEXT:   40016c:  23 c0 1c 03  subu    $24, $24, $gp
-# PLT-NEXT:   400170:  21 78 e0 03  move    $15, $ra
+# PLT-NEXT:   400170:  25 78 e0 03  move    $15, $ra
 # PLT-NEXT:   400174:  82 c0 18 00  srl     $24, $24, 2
 # PLT-NEXT:   400178:  09 f8 20 03  jalr    $25
 # PLT-NEXT:   40017c:  fe ff 18 27  addiu   $24, $24, -2




More information about the llvm-commits mailing list