summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-03-23 16:39:22 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-03-23 16:41:57 +0000
commitb5419d1eee63ecf0fad653ca0d394e03aad0a98a (patch)
tree4de0b7e25303770d86ca60679d6fc73002ab3157
parent7c6f02e44df7953a8c43b95150c7e766213c8f4d (diff)
downloadbinutils-gdb-users/nalcock/ctf-sanitized.tar.gz
ld: do not rely on the exact size of the CTF symtypetabs in test resultsusers/nalcock/ctf-sanitized
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-23 Nick Alcock <nick.alcock@oracle.com> * 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.
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/testsuite/ld-ctf/array.d2
-rw-r--r--ld/testsuite/ld-ctf/data-func-conflicted.d6
-rw-r--r--ld/testsuite/ld-ctf/diag-parlabel.d4
-rw-r--r--ld/testsuite/ld-ctf/function.d2
-rw-r--r--ld/testsuite/ld-ctf/slice.d2
6 files changed, 18 insertions, 8 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 19b56f02b54..54201c7bd22 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2021-03-23 Nick Alcock <nick.alcock@oracle.com>
+
+ * 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 <mliska@suse.cz>
* emultempl/aix.em: Replace usage of CONST_STRNEQ with startswith.
diff --git a/ld/testsuite/ld-ctf/array.d b/ld/testsuite/ld-ctf/array.d
index 16375620c03..ab262d915b5 100644
--- a/ld/testsuite/ld-ctf/array.d
+++ b/ld/testsuite/ld-ctf/array.d
@@ -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: .*
diff --git a/ld/testsuite/ld-ctf/data-func-conflicted.d b/ld/testsuite/ld-ctf/data-func-conflicted.d
index 1e7c19a5b36..87dd4b61e3b 100644
--- a/ld/testsuite/ld-ctf/data-func-conflicted.d
+++ b/ld/testsuite/ld-ctf/data-func-conflicted.d
@@ -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: .*
@@ -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: .*
diff --git a/ld/testsuite/ld-ctf/diag-parlabel.d b/ld/testsuite/ld-ctf/diag-parlabel.d
index bba161cf309..9d2c0860997 100644
--- a/ld/testsuite/ld-ctf/diag-parlabel.d
+++ b/ld/testsuite/ld-ctf/diag-parlabel.d
@@ -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:
diff --git a/ld/testsuite/ld-ctf/function.d b/ld/testsuite/ld-ctf/function.d
index 1584bdbedfd..e6cb20951f4 100644
--- a/ld/testsuite/ld-ctf/function.d
+++ b/ld/testsuite/ld-ctf/function.d
@@ -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: .*
#...
diff --git a/ld/testsuite/ld-ctf/slice.d b/ld/testsuite/ld-ctf/slice.d
index 72a7074f9ef..efe32a87523 100644
--- a/ld/testsuite/ld-ctf/slice.d
+++ b/ld/testsuite/ld-ctf/slice.d
@@ -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: .*
#...