summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-01-28 13:18:58 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-03-18 13:33:12 +0000
commita663c0511619a3a2b331269e38444ea47b79e9e5 (patch)
tree66b908ee36821047c8f530f19659a2ed7001259f
parent69a284867c7c92960653cbeab6f79cd815f1342f (diff)
downloadbinutils-gdb-users/nalcock/ctf-gcc-11.tar.gz
libctf: fix test results for DWARF->CTF GCC 11users/nalcock/ctf-gcc-11
A few type ordering differences, a better emission of slices, and emission of the underlying integral type for enumerated types. Change the configure flag from -gt to -gctf. Not for upstreaming quite yet.
-rw-r--r--ld/testsuite/ld-ctf/array.d2
-rw-r--r--ld/testsuite/ld-ctf/conflicting-enums.d2
-rw-r--r--ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d4
-rw-r--r--ld/testsuite/ld-ctf/cross-tu-noncyclic.d6
-rw-r--r--ld/testsuite/ld-ctf/ctf.exp2
-rw-r--r--ld/testsuite/ld-ctf/data-func-conflicted.d2
-rw-r--r--ld/testsuite/ld-ctf/enums.d8
-rw-r--r--ld/testsuite/ld-ctf/slice.d11
-rw-r--r--ld/testsuite/lib/ld-lib.exp4
-rw-r--r--libctf/testsuite/lib/ctf-lib.exp4
-rw-r--r--libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.lk1
11 files changed, 24 insertions, 22 deletions
diff --git a/ld/testsuite/ld-ctf/array.d b/ld/testsuite/ld-ctf/array.d
index 16375620c03..c8b2b8e7378 100644
--- a/ld/testsuite/ld-ctf/array.d
+++ b/ld/testsuite/ld-ctf/array.d
@@ -14,7 +14,7 @@ Contents of CTF section .ctf:
Version: 4 \(CTF_VERSION_3\)
#...
Data object section: .* \(0x8 bytes\)
- Type section: .* \(0x5c bytes\)
+ Type section: .* \(0x6c bytes\)
String section: .*
Labels:
diff --git a/ld/testsuite/ld-ctf/conflicting-enums.d b/ld/testsuite/ld-ctf/conflicting-enums.d
index f90aaef44b1..5eeae7a13ed 100644
--- a/ld/testsuite/ld-ctf/conflicting-enums.d
+++ b/ld/testsuite/ld-ctf/conflicting-enums.d
@@ -14,7 +14,7 @@ Contents of CTF section .ctf:
Version: 4 \(CTF_VERSION_3\)
#...
Types:
-
+#...
Strings:
#...
CTF archive member: .*enum.*\.c:
diff --git a/ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d b/ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d
index eaf8e79c8ad..6d5e869bfbe 100644
--- a/ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d
+++ b/ld/testsuite/ld-ctf/cross-tu-cyclic-conflicting.d
@@ -14,12 +14,12 @@ Contents of CTF section \.ctf:
#...
Types:
#...
- 0x[0-9a-f]*: \(kind 1\) long int \(format 0x1\) \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
-#...
0x[0-9a-f]*: \(kind 6\) struct B .*
#...
0x[0-9a-f]*: \(kind 1\) int \(format 0x1\) \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
#...
+ 0x[0-9a-f]*: \(kind 1\) long int \(format 0x1\) \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
+#...
0x[0-9a-f]*: \(kind 9\) struct A
#...
0x[0-9a-f]*: \(kind 6\) struct C .*
diff --git a/ld/testsuite/ld-ctf/cross-tu-noncyclic.d b/ld/testsuite/ld-ctf/cross-tu-noncyclic.d
index e8fc7a49aa5..3ebc52dcb3b 100644
--- a/ld/testsuite/ld-ctf/cross-tu-noncyclic.d
+++ b/ld/testsuite/ld-ctf/cross-tu-noncyclic.d
@@ -29,13 +29,13 @@ Contents of CTF section .ctf:
Types:
#...
+ 0x[0-9a-f]*: \(kind 6\) struct B .*
+ *\[0x0\] foo: ID 0x[0-9a-f]*: \(kind 1\) int .*
+#...
0x[0-9a-f]*: \(kind 6\) struct A .*
*\[0x0\] a: ID 0x[0-9a-f]*: \(kind 1\) long int .*
*\[0x[0-9a-f]*\] foo: ID 0x[0-9a-f]*: \(kind 3\) struct B \* .*
#...
- 0x[0-9a-f]*: \(kind 6\) struct B .*
- *\[0x0\] foo: ID 0x[0-9a-f]*: \(kind 1\) int .*
-#...
0x[0-9a-f]*: \(kind 3\) struct B \* \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\) -> 0x[0-9a-f]*: \(kind 6\) struct B .*
#...
0x[0-9a-f]*: \(kind 3\) struct A \* \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\) -> 0x[0-9a-f]*: \(kind 6\) struct A .*
diff --git a/ld/testsuite/ld-ctf/ctf.exp b/ld/testsuite/ld-ctf/ctf.exp
index c5f6d5cec5b..0e74d6c569c 100644
--- a/ld/testsuite/ld-ctf/ctf.exp
+++ b/ld/testsuite/ld-ctf/ctf.exp
@@ -42,7 +42,7 @@ foreach ctf_test $ctf_test_list {
}
}
verbose [file rootname $ctf_test]
- run_dump_test [file rootname $ctf_test] { { cc "-gt -fPIC" } }
+ run_dump_test [file rootname $ctf_test] { { cc "-gctf -fPIC" } }
}
if {[info exists old_lc_all]} {
diff --git a/ld/testsuite/ld-ctf/data-func-conflicted.d b/ld/testsuite/ld-ctf/data-func-conflicted.d
index 1e7c19a5b36..8d6ba31b5e0 100644
--- a/ld/testsuite/ld-ctf/data-func-conflicted.d
+++ b/ld/testsuite/ld-ctf/data-func-conflicted.d
@@ -16,7 +16,7 @@ Contents of CTF section \.ctf:
Data object section: .* \(0xc bytes\)
Function info section: .* \(0x44 bytes\)
Object index section: .* \(0xc bytes\)
- Type section: .* \(0xf4 bytes\)
+ Type section: .* \(0x118 bytes\)
String section: .*
#...
Data objects:
diff --git a/ld/testsuite/ld-ctf/enums.d b/ld/testsuite/ld-ctf/enums.d
index f1cf70de5af..d36c7e19f7f 100644
--- a/ld/testsuite/ld-ctf/enums.d
+++ b/ld/testsuite/ld-ctf/enums.d
@@ -14,7 +14,7 @@ Contents of CTF section .ctf:
#...
Compilation unit name: .*enums.c
#...
- Type section: .*\(0x114 bytes\)
+ Type section: .*\(0x134 bytes\)
#...
Types:
0x1: \(kind 8\) enum nine_els \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
@@ -27,7 +27,8 @@ Contents of CTF section .ctf:
NINE_SEVEN: 260
NINE_EIGHT: 261
NINE_NINE: 262
- 0x2: \(kind 8\) enum ten_els \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
+ 0x2: \(kind 1\) .*int \(format 0x[01]\) \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]\)
+ 0x3: \(kind 8\) enum ten_els \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
TEN_ONE: 10
TEN_TWO: 11
TEN_THREE: -256
@@ -38,7 +39,8 @@ Contents of CTF section .ctf:
TEN_EIGHT: -251
TEN_NINE: -250
TEN_TEN: -249
- 0x3: \(kind 8\) enum eleven_els \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
+ 0x4: \(kind 1\) .*int \(format 0x[01]\) \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
+ 0x5: \(kind 8\) enum eleven_els \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
ELEVEN_ONE: 10
ELEVEN_TWO: 11
ELEVEN_THREE: -256
diff --git a/ld/testsuite/ld-ctf/slice.d b/ld/testsuite/ld-ctf/slice.d
index 72a7074f9ef..e39f19399dc 100644
--- a/ld/testsuite/ld-ctf/slice.d
+++ b/ld/testsuite/ld-ctf/slice.d
@@ -15,7 +15,7 @@ Contents of CTF section .ctf:
Compilation unit name: .*slice.c
#...
Data object section: .* \(0x4 bytes\)
- Type section: .* \(0xd0 bytes\)
+ Type section: .* \(0xe0 bytes\)
String section: .*
#...
Data objects:
@@ -25,8 +25,9 @@ Contents of CTF section .ctf:
#...
0x[0-9a-f]*: \(kind 6\) struct slices \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
*\[0x0\] one: ID 0x[0-9a-f]*: \(kind 1\) int:1 \[slice 0x0:0x1\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
- *\[0x1\] two: ID 0x[0-9a-f]*: \(kind 1\) int:2 \[slice 0x1:0x2\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
- *\[0x3\] six: ID 0x[0-9a-f]*: \(kind 1\) int:6 \[slice 0x3:0x6\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
- *\[0x9\] ten: ID 0x[0-9a-f]*: \(kind 1\) int:10 \[slice 0x9:0xa\] \(format 0x1\) \(size 0x2\) \(aligned at 0x2\)
- *\[0x13\] bar: ID 0x[0-9a-f]*: \(kind 8\) enum foo:1 \[slice 0x13:0x1\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+ *\[0x1\] two: ID 0x[0-9a-f]*: \(kind 1\) int:2 \[slice 0x0:0x2\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+ *\[0x3\] six: ID 0x[0-9a-f]*: \(kind 1\) int:6 \[slice 0x0:0x6\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+ *\[0x9\] ten: ID 0x[0-9a-f]*: \(kind 1\) int:10 \[slice 0x0:0xa\] \(format 0x1\) \(size 0x2\) \(aligned at 0x2\)
+ *\[0x13\] bar: ID 0x[0-9a-f]*: \(kind 8\) enum foo:1 \[slice 0x0:0x1\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+
#...
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index a56c945f9b1..b1080889a8e 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1625,7 +1625,7 @@ proc compile_one_cc { src output additional_flags } {
return [run_host_cmd_yesno "$CC" "$flags $CFLAGS $additional_flags $src -o $output"]
}
-# Returns true if the target compiler supports -gt
+# Returns true if the target compiler supports -gctf
proc check_ctf_available { } {
global ctf_available_saved
@@ -1639,7 +1639,7 @@ proc check_ctf_available { } {
set f [open $src "w"]
puts $f "int main() { return 0; }"
close $f
- set ctf_available_saved [compile_one_cc $src $output "-gt -c"]
+ set ctf_available_saved [compile_one_cc $src $output "-gctf -c"]
remote_file host delete $src
remote_file host delete $output
file delete $src
diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp
index 2f1742c8755..0fb095829c6 100644
--- a/libctf/testsuite/lib/ctf-lib.exp
+++ b/libctf/testsuite/lib/ctf-lib.exp
@@ -197,10 +197,10 @@ proc run_lookup_test { name } {
set lookup_flags ""
if { $run_ld } {
set lookup_output "tmpdir/out.so"
- set lookup_flags "-gt -fPIC $shared $opts(link_flags)"
+ set lookup_flags "-gctf -fPIC $shared $opts(link_flags)"
} else {
set lookup_output "tmpdir/out.o"
- set lookup_flags "-gt -fPIC -c"
+ set lookup_flags "-gctf -fPIC -c"
}
if [board_info [target_info name] exists cflags] {
append lookup_flags " [board_info [target_info name] cflags]"
diff --git a/libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.lk b/libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.lk
index 68c777fef66..7e31a37557c 100644
--- a/libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.lk
+++ b/libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.lk
@@ -4,4 +4,3 @@
# link_flags: -Wl,--ctf-variables -r
foo is of type [0-9a-f]*
bar is of type [0-9a-f]*
-foo missing from the data object section