Skip to content

Commit

Permalink
ld: do not rely on the exact size of the CTF symtypetabs in test results
Browse files Browse the repository at this point in the history
The data object and function info sections (collectively "symtypetabs")
usually (i.e. if non-indexed) have sizes defined by the size of the ELF
dynamic symbol table in the object they are linked to.  This means test
results should not depend on the exact sizes of these sections, because
adding entirely irrelevant symbols to the dynsym can cause spurious test
failures.  (This also means we should not match the offset of sections
that follow them, since those too depend on the exact size of the
symtypetab sections.)

Spotted by turning the sanitizer on, which introduced new dynsym entries
and expanded the symtypetab sizes to match.

ld/ChangeLog
2021-03-25  Nick Alcock  <[email protected]>

	* testsuite/ld-ctf/array.d: Only check that the data object
	section is nonempty: do not check its exact size.
	* testsuite/ld-ctf/diag-parlabel.d: Likewise.
	* testsuite/ld-ctf/slice.d: Likewise.
	* testsuite/ld-ctf/data-func-conflicted.d: Likewise, and for the
	func info section too.
	* testsuite/ld-ctf/function.d: Likewise, for the func info section.
  • Loading branch information
nickalcock committed Mar 25, 2021
1 parent 8f7b22e commit 8592be8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
10 changes: 10 additions & 0 deletions ld/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2021-03-25 Nick Alcock <[email protected]>

* testsuite/ld-ctf/array.d: Only check that the data object
section is nonempty: do not check its exact size.
* testsuite/ld-ctf/diag-parlabel.d: Likewise.
* testsuite/ld-ctf/slice.d: Likewise.
* testsuite/ld-ctf/data-func-conflicted.d: Likewise, and for the
func info section too.
* testsuite/ld-ctf/function.d: Likewise, for the func info section.

2021-03-22 Martin Liska <[email protected]>

* emultempl/aix.em: Replace usage of CONST_STRNEQ with startswith.
Expand Down
2 changes: 1 addition & 1 deletion ld/testsuite/ld-ctf/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Contents of CTF section .ctf:
Magic number: 0xdff2
Version: 4 \(CTF_VERSION_3\)
#...
Data object section: .* \(0x8 bytes\)
Data object section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Type section: .* \(0x5c bytes\)
String section: .*

Expand Down
6 changes: 3 additions & 3 deletions ld/testsuite/ld-ctf/data-func-conflicted.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Contents of CTF section \.ctf:
Magic number: 0xdff2
Version: 4 \(CTF_VERSION_3\)
#...
Data object section: .* \(0xc bytes\)
Function info section: .* \(0x44 bytes\)
Data object section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Function info section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Object index section: .* \(0xc bytes\)
Type section: .* \(0xf4 bytes\)
String section: .*
Expand All @@ -39,7 +39,7 @@ CTF archive member: .*/data-func-1\.c:
#...
Parent name: \.ctf
Compilation unit name: .*/data-func-1\.c
Data object section: .* \(0xfa4 bytes\)
Data object section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Type section: .* \(0xc bytes\)
String section: .*

Expand Down
4 changes: 2 additions & 2 deletions ld/testsuite/ld-ctf/diag-parlabel.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Contents of CTF section .ctf:
Version: 4 \(CTF_VERSION_3\)
#...
Compilation unit name: .*A.c
Data object section: 0x0 -- 0x3 \(0x4 bytes\)
Type section: 0x4 -- 0x33 \(0x30 bytes\)
Data object section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Type section: .* \(0x30 bytes\)
String section: .*

Labels:
Expand Down
2 changes: 1 addition & 1 deletion ld/testsuite/ld-ctf/function.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Contents of CTF section .ctf:
Version: 4 \(CTF_VERSION_3\)
#...
Compilation unit name: .*function.c
Function info section: .* \(0x4 bytes\)
Function info section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Type section: .* \(0x90 bytes\)
String section: .*
#...
Expand Down
2 changes: 1 addition & 1 deletion ld/testsuite/ld-ctf/slice.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Contents of CTF section .ctf:
#...
Compilation unit name: .*slice.c
#...
Data object section: .* \(0x4 bytes\)
Data object section: .* \(0x[1-9a-f][0-9a-f]* bytes\)
Type section: .* \(0xd0 bytes\)
String section: .*
#...
Expand Down

0 comments on commit 8592be8

Please sign in to comment.