]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Changed ld and gas BPF tests
authorCupertino Miranda <cupertino.miranda@oracle.com>
Fri, 17 Mar 2023 15:29:36 +0000 (15:29 +0000)
committerCupertino Miranda <cupertino.miranda@oracle.com>
Mon, 20 Mar 2023 15:35:21 +0000 (15:35 +0000)
Recent BPF patch removed and renamed the list of relocations based on
the limitations of BPF instruction set.
This patch is a correction to the tests.

13 files changed:
gas/testsuite/gas/bpf/indcall-1.d
ld/testsuite/ld-bpf/baz.s [deleted file]
ld/testsuite/ld-bpf/call-1.d
ld/testsuite/ld-bpf/jump-1.d [deleted file]
ld/testsuite/ld-bpf/reloc-data-be.d
ld/testsuite/ld-bpf/reloc-data-le.d
ld/testsuite/ld-bpf/reloc-data.s
ld/testsuite/ld-bpf/reloc-insn-external-be.d
ld/testsuite/ld-bpf/reloc-insn-external-le.d
ld/testsuite/ld-bpf/reloc-insn-external.s
ld/testsuite/ld-bpf/reloc-insn32-be.d [deleted file]
ld/testsuite/ld-bpf/reloc-insn32-le.d [deleted file]
ld/testsuite/ld-bpf/reloc-insn32.s [deleted file]

index e61e1259fe557a4f1ad1eb4ff38db220416af47a..b26e8f8853fc59e67fb00fa7c7e8510b70a2173a 100644 (file)
@@ -12,7 +12,7 @@ Disassembly of section \.text:
   10:  b7 02 00 00 02 00 00 00         mov %r2,2
   18:  18 06 00 00 38 00 00 00         lddw %r6,0x38
   20:  00 00 00 00 00 00 00 00[    ]*
-                       18: R_BPF_INSN_64       .text
+                       18: R_BPF_64_64 .text
   28:  8d 06 00 00 00 00 00 00         call %r6
   30:  95 00 00 00 00 00 00 00         exit
 
diff --git a/ld/testsuite/ld-bpf/baz.s b/ld/testsuite/ld-bpf/baz.s
deleted file mode 100644 (file)
index 2e159a8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-        mov %r1,1
-        mov %r2,2
-        mov %r3,3
-        ja bar
-        exit
index d44c14e92463fa72c327d6eaf4e50b713818539e..aad51d5cedc9c3f2c04413fbfcc0cc5990f74850 100644 (file)
@@ -3,7 +3,7 @@
 #source: bar.s
 #objdump: -dr
 #ld: -EL
-#name: CALL with disp32 reloc
+#name: CALL with 64_32 reloc
 
 .*: +file format .*bpf.*
 
diff --git a/ld/testsuite/ld-bpf/jump-1.d b/ld/testsuite/ld-bpf/jump-1.d
deleted file mode 100644 (file)
index 0e3de4e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#as: --EL
-#source: baz.s
-#source: bar.s
-#objdump: -dr
-#ld: -EL
-#name: jump with disp16 reloc
-
-.*: +file format .*bpf.*
-
-Disassembly of section .text:
-
-[0-9a-f]+ <.*>:
- *[0-9a-f]+:   b7 01 00 00 01 00 00 00         mov %r1,1
- *[0-9a-f]+:   b7 02 00 00 02 00 00 00         mov %r2,2
- *[0-9a-f]+:   b7 03 00 00 03 00 00 00         mov %r3,3
- *[0-9a-f]+:   05 00 01 00 00 00 00 00         ja 1
- *[0-9a-f]+:   95 00 00 00 00 00 00 00         exit
-
-[0-9a-f]+ <bar>:
- *[0-9a-f]+:   bf 21 00 00 00 00 00 00         mov %r1,%r2
- *[0-9a-f]+:   bf 13 00 00 00 00 00 00         mov %r3,%r1
- *[0-9a-f]+:   95 00 00 00 00 00 00 00         exit
index 4d793e2b41a92bc37b0b52025d6daf40d5e2b43b..05734b12094467c87d37068d419609c0db43ff53 100644 (file)
@@ -8,4 +8,4 @@
 
 Contents of section \.data:
  0020 666f6f00 62617200 00000000 00000020  .*
- 0030 00000028 003034                      .*
+ 0030 00000028                             .*
index 97cb1b36a2a0c70e0329995f3846b541d534142e..8cabc7fae5cfbdd80fc337c6234ded273c1c07cb 100644 (file)
@@ -8,4 +8,4 @@
 
 Contents of section \.data:
  0020 666f6f00 62617200 20000000 00000000  .*
- 0030 28000000 300034                      .*
+ 0030 28000000                             .*
index 431ef5aef6177615e45238a8c33c511ee302649c..90a5ff0689632bfc12f669414631bac1385b3c7f 100644 (file)
@@ -10,7 +10,3 @@ d64:
     .quad foo
 d32:
     .word d64
-d16:
-    .half d32
-d8:
-    .byte d16
index 032d3649d2a8dcfc477fb871aec7792a67cc3a0d..455daa701f7c6d09bcad80d87300ff38670ea1ad 100644 (file)
@@ -12,5 +12,3 @@ Disassembly of section .text:
 [0-9a-f]+ <.*>:
  *[0-9a-f]+:   18 10 00 00 00 00 00 28[        ]*lddw %r1,0x28
  *[0-9a-f]+:   00 00 00 00 00 00 00 00[        ]*
- *[0-9a-f]+:   b7 20 00 00 00 00 00 26[        ]*mov %r2,0x26
- *[0-9a-f]+:   61 34 00 24 00 00 00 00[        ]*ldxw %r3,\[%r4\+0x24\]
index d3513766ee841310d6f0e2ff67b4ff14db1c10af..51066388e8446fbc9f771cbf634b4c5f6f20dd6e 100644 (file)
@@ -12,5 +12,3 @@ Disassembly of section .text:
 [0-9a-f]+ <.*>:
  *[0-9a-f]+:   18 01 00 00 28 00 00 00[        ]*lddw %r1,0x28
  *[0-9a-f]+:   00 00 00 00 00 00 00 00[        ]*
- *[0-9a-f]+:   b7 02 00 00 26 00 00 00[        ]*mov %r2,0x26
- *[0-9a-f]+:   61 43 24 00 00 00 00 00[        ]*ldxw %r3,\[%r4\+0x24\]
index be12813934a591adf4776194276586c4e7d33a60..41a35b40afe3285fb52ea305b3aeb06ef99be4ac 100644 (file)
@@ -1,5 +1,2 @@
 
     lddw %r1, bar + 4
-    mov %r2, bar + 2
-
-    ldxw %r3, [%r4 + bar]
diff --git a/ld/testsuite/ld-bpf/reloc-insn32-be.d b/ld/testsuite/ld-bpf/reloc-insn32-be.d
deleted file mode 100644 (file)
index 27d592d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#as: --EB
-#source: reloc-insn32.s
-#objdump: -d
-#ld: -Tdata=0xdabeef -EB
-#name: reloc INSN32 BE
-
-.*: +file format .*bpfbe
-
-Disassembly of section .text:
-
-[0-9a-f]+ <main>:
- *[0-9a-f]+:   b7 10 00 00 00 da be f3[        ]*mov %r1,0xdabef3
- *[0-9a-f]+:   16 10 00 02 00 da be f3[        ]*jeq32 %r1,0xdabef3,2
- *[0-9a-f]+:   38 00 00 00 00 da be ff[        ]*ldabsdw 0xdabeff
- *[0-9a-f]+:   95 00 00 00 00 00 00 00[        ]*exit
-
-[0-9a-f]+ <baz>:
- *[0-9a-f]+:   07 10 00 00 00 da be ef[        ]*add %r1,0xdabeef
- *[0-9a-f]+:   62 20 00 08 00 da be f7[        ]*stw \[%r2\+8\],0xdabef7
diff --git a/ld/testsuite/ld-bpf/reloc-insn32-le.d b/ld/testsuite/ld-bpf/reloc-insn32-le.d
deleted file mode 100644 (file)
index bdbb45f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#as: --EL
-#source: reloc-insn32.s
-#objdump: -d
-#ld: -Tdata=0xdabeef -EL
-#name: reloc INSN32 LE
-
-.*: +file format .*bpfle
-
-Disassembly of section .text:
-
-[0-9a-f]+ <main>:
- *[0-9a-f]+:   b7 01 00 00 f3 be da 00[        ]*mov %r1,0xdabef3
- *[0-9a-f]+:   16 01 02 00 f3 be da 00[        ]*jeq32 %r1,0xdabef3,2
- *[0-9a-f]+:   38 00 00 00 ff be da 00[        ]*ldabsdw 0xdabeff
- *[0-9a-f]+:   95 00 00 00 00 00 00 00[        ]*exit
-
-[0-9a-f]+ <baz>:
- *[0-9a-f]+:   07 01 00 00 ef be da 00[        ]*add %r1,0xdabeef
- *[0-9a-f]+:   62 02 08 00 f7 be da 00[        ]*stw \[%r2\+8\],0xdabef7
diff --git a/ld/testsuite/ld-bpf/reloc-insn32.s b/ld/testsuite/ld-bpf/reloc-insn32.s
deleted file mode 100644 (file)
index a53a0dc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-    .data
-foo:
-    .string "foo"
-bar:
-    .string "bar"
-d64:
-    .dword bar
-d32:
-    .word d64
-
-    .text
-main:
-    mov %r1, bar
-    jeq32 %r1, bar, baz
-    ldabsdw d32
-    exit
-
-baz:
-    add %r1, foo
-    stw [%r2 + 8], d64