diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2021-05-06 09:30:58 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2021-05-06 09:31:31 +0100 |
commit | ae064303efe5830e6b9901ce2e4ed241a3cda8e7 (patch) | |
tree | 11dc2fe833c1460029e4c5d1bd727d99f838d359 /libctf | |
parent | 49da556c658684db1b8bdba956e541bc99628f02 (diff) | |
download | gdb-ae064303efe5830e6b9901ce2e4ed241a3cda8e7.zip gdb-ae064303efe5830e6b9901ce2e4ed241a3cda8e7.tar.gz gdb-ae064303efe5830e6b9901ce2e4ed241a3cda8e7.tar.bz2 |
libctf, ld: fix test results for upstream GCC
The tests currently in binutils are aimed at the original GCC-based
implementation of CTF, which emitted CTF directly from GCC's internal
representation. The approach now under review emits CTF from DWARF,
with an eye to eventually doing this for all non-DWARF debuginfo-like
formats GCC supports. It also uses a different flag to enable
CTF emission (-gctf rather than -gt).
Adjust the testsuite accordingly.
Given that the ld testsuite results are dependent on type ordering,
which we do not guarantee at all, it's amazing how little changes. We
see a few type ordering differences, slices change because the old GCC
was buggy (slices were emitted "backwards", from the wrong end of the
machine word) and its expected results were wrong, and GCC now emits the
underlying integral type for enumerated types, though CTF has no way to
record this yet (coming in v4).
GCC also now emits even hidden symbols into the symtab (and thus
symtypetab), so one symtypetab test changes its expected results
slightly to compensate.
Also add tests for the CTF_K_UNKNOWN nonrepresentable type: this
couldn't be done before now since the only GCC that emits CTF_K_UNKNOWN
for nonrepresentable types is the new one.
ld/ChangeLog
2021-05-06 Nick Alcock <nick.alcock@oracle.com>
* testsuite/ld-ctf/ctf.exp: Use -gctf, not -gt.
* testsuite/lib/ld-lib.exp: Likewise.
* testsuite/ld-ctf/nonrepresentable-1.c: New test for nonrepresentable types.
* testsuite/ld-ctf/nonrepresentable-2.c: Likewise.
* testsuite/ld-ctf/nonrepresentable.d: Likewise.
* testsuite/ld-ctf/array.d: Larger type section.
* testsuite/ld-ctf/data-func-conflicted.d: Likewise.
* testsuite/ld-ctf/enums.d: Likewise.
* testsuite/ld-ctf/conflicting-enums.d: Don't compare types.
* testsuite/ld-ctf/cross-tu-cyclic-conflicting.d: Changed type order.
* testsuite/ld-ctf/cross-tu-noncyclic.d: Likewise.
* testsuite/ld-ctf/slice.d: Adjust for improved slice emission.
libctf/ChangeLog
2021-05-06 Nick Alcock <nick.alcock@oracle.com>
* testsuite/lib/ctf-lib.exp: Use -gctf, not -gt.
* testsuite/libctf-regression/nonstatic-var-section-ld-r.lk:
Hidden symbols now get into the symtypetab anyway.
Diffstat (limited to 'libctf')
-rw-r--r-- | libctf/ChangeLog | 6 | ||||
-rw-r--r-- | libctf/testsuite/lib/ctf-lib.exp | 4 | ||||
-rw-r--r-- | libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.lk | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 51ecc85..979c6c5 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,11 @@ 2021-05-06 Nick Alcock <nick.alcock@oracle.com> + * testsuite/lib/ctf-lib.exp: Use -gctf, not -gt. + * testsuite/libctf-regression/nonstatic-var-section-ld-r.lk: + Hidden symbols now get into the symtypetab anyway. + +2021-05-06 Nick Alcock <nick.alcock@oracle.com> + * ctf-open.c (init_types): Unknown types may have names. * ctf-types.c (ctf_type_resolve): CTF_K_UNKNOWN is as non-representable as type ID 0. diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp index 2f1742c..0fb0958 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 68c777f..7e31a37 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 |