mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
ae064303ef
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.
36 lines
668 B
Makefile
36 lines
668 B
Makefile
#as:
|
|
#source: array-char.c
|
|
#source: array-int.c
|
|
#objdump: --ctf=.ctf
|
|
#ld: -shared --ctf-variables --hash-style=sysv
|
|
#name: Arrays
|
|
|
|
.*: +file format .*
|
|
|
|
Contents of CTF section .ctf:
|
|
|
|
Header:
|
|
Magic number: 0xdff2
|
|
Version: 4 \(CTF_VERSION_3\)
|
|
#...
|
|
Data object section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
|
|
Type section: .* \(0x6c bytes\)
|
|
String section: .*
|
|
|
|
Labels:
|
|
|
|
Data objects:
|
|
digits -> 0x[0-9a-f]*: \(kind 4\) int \[10\] .*
|
|
digits_names -> 0x[0-9a-f]*: \(kind 4\) char \*\[10\] .*
|
|
|
|
Function objects:
|
|
|
|
Variables:
|
|
|
|
Types:
|
|
#...
|
|
0x[0-9a-f]*: \(kind 4\) .*\[10\] \(size .*
|
|
#...
|
|
0x[0-9a-f]*: \(kind 4\) .*\[10\] \(size .*
|
|
#...
|