ld: do not rely on the exact size of the CTF symtypetabs in test results
authorNick Alcock <nick.alcock@oracle.com>
Thu, 25 Mar 2021 16:32:46 +0000 (16:32 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 25 Mar 2021 16:32:53 +0000 (16:32 +0000)
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  <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.

ld/ChangeLog
ld/testsuite/ld-ctf/array.d
ld/testsuite/ld-ctf/data-func-conflicted.d
ld/testsuite/ld-ctf/diag-parlabel.d
ld/testsuite/ld-ctf/function.d
ld/testsuite/ld-ctf/slice.d

index 19b56f02b549bb3cff5da160b660d05de95903df..c10bc392fd14fb0b90119d9548e98bc69b922760 100644 (file)
@@ -1,3 +1,13 @@
+2021-03-25  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.
index 16375620c03c796e6d0a077e3bf7e51750552e51..ab262d915b53f28487e819736bda8f49054e156d 100644 (file)
@@ -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:    .*
 
index 1e7c19a5b364401f7e8b8be55b5e48bfc1cbebe2..87dd4b61e3b7d53a4371a2d2c1d0eea8980fa5ca 100644 (file)
@@ -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:    .*
 
index bba161cf3093a4d974eb76b0518f3d0a2adaeadf..9d2c0860997e0215774251909a8a7337c38f4257 100644 (file)
@@ -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:
index 1584bdbedfd6df9cefca1179bf6c42c5093ee663..e6cb20951f48681bf210e4685337db9da50f07f7 100644 (file)
@@ -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:    .*
 #...
index 72a7074f9efca56c057d1539ca33070cddf6a9d5..efe32a87523f05fcd8c483bbf56d8a9af19473aa 100644 (file)
@@ -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:    .*
 #...
This page took 0.027655 seconds and 4 git commands to generate.