[PATCH] ld: Disable ifunc tests on Solaris

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] ld: Disable ifunc tests on Solaris

Rainer Orth-2
A couple of ld ifunc tests currently FAIL on 64-bit Solaris/x86:

FAIL: ld-ifunc/ifunc-10-x86-64
FAIL: ld-ifunc/ifunc-11-x86-64
FAIL: ld-ifunc/ifunc-12-x86-64
FAIL: ld-ifunc/ifunc-13-x86-64
FAIL: ld-ifunc/ifunc-14a-x86-64
FAIL: ld-ifunc/ifunc-14b-x86-64
FAIL: ld-ifunc/ifunc-14c-x86-64
FAIL: ld-ifunc/ifunc-14d-x86-64
FAIL: ld-ifunc/ifunc-14e-x86-64
FAIL: ld-ifunc/ifunc-14f-x86-64
FAIL: ld-ifunc/ifunc-15-x86-64
FAIL: ld-ifunc/ifunc-17a-x86-64
FAIL: ld-ifunc/ifunc-17b-x86-64
FAIL: ld-ifunc/ifunc-2-local-x86-64-now
FAIL: ld-ifunc/ifunc-2-local-x86-64
FAIL: ld-ifunc/ifunc-2-x86-64-now
FAIL: ld-ifunc/ifunc-2-x86-64
FAIL: ld-ifunc/ifunc-20-x86-64
FAIL: ld-ifunc/pr17154-x86-64-now
FAIL: ld-ifunc/pr17154-x86-64

For one, the actuall error is weird:

./ld-new: target elf64-x86-64 not found
failed with: <./ld-new: target elf64-x86-64 not found>, no expected output
FAIL: ld-ifunc/ifunc-10-x86-64

although ld -V does report the elf_x86_64 emulation as supported:

$ ./ld/ld-new -V
GNU ld (GNU Binutils) 2.34.50.20200328
  Supported emulations:
   elf_x86_64_sol2
   elf_x86_64
[...]

When using ld -m elf_x86_64_sol2 instead, one of the testcases links
successfully.

However, there's no point in pursuing this: Solaris does not support
ifunc, as can be seen in <sys/elf.h>:

/*
 * GNU/Linux specific symbol type not used by Solaris
 */
#define STT_GNU_IFUNC   10

and never will, given that it has symbol capabilities as solution to
effectively the same problem:

http://www.linker-aliens.org/blogs/rie/entry/symbol_capabilitie/

Therefore I'd like to disable ifunc testing on Solaris completely.
There are two possible solutions:

* Explicitly reject Solaris in ld/testsuite/ld-ifunc/ifunc.exp.

* Remove Solaris from binutils/testsuite/lib/binutils-common.exp
  (supports_gnu_osabi).  The comment there seems confusing:

# True if the ELF target supports setting the ELF header OSABI field
# to ELFOSABI_GNU or ELFOSABI_FREEBSD, a requirement for STT_GNU_IFUNC
# symbol and SHF_GNU_MBIND section support.

  Why wouldn't one be able to set the OSABI field?  It's a file after
  all ;-)  Isn't the question if the extensions covered by ELFOSABI_GNU
  are handled at runtime?

  Whatever the case, it seems right to disable this on Solaris: the
  ifunc part is covered above.  SHF_GNU_MBIND is in the OS-specific
  range and conflicts with

#define SHF_SUNW_REALLOC        0x01000000      /* internal: krtld realloc */

  While the comment suggests this might be relocatable without too much
  problems, the description of mbind (no formal spec AFAICS, just the
  comment in the binutils patch submission) strongly suggests that this
  isn't relevant to Solaris at all.

  Indirectly, clearing supports_gnu_osabi on Solaris disables
  supports_gnu_unique.  Again, Solaris <sys/elf.h> has

/*
 * GNU/Linux specific binding not used by Solaris
 */
#define STB_GNU_UNIQUE  10

  so this seems the right thing to do.

* Either way, one can remove the explicit mentions of *-*-solaris2* in
  quite a number of (but not all) the ld-ifunc dump file notarget lists.
  I suspect a similar solution is possible for the other targets
  routinely listed there (*-*-lynxos *-*-nacl* *-*-nto*), but I know
  nothing about those and will thus leave them alone.

I went for the supports_gnu_osabi solution, but there's one fallout: two
gas tests now XPASS because the are xfail'ed for !supports_gnu_osabi:

XPASS: mbind sections 12
XPASS: mbind section contents 16
XPASS: mbind sections 16
XPASS: mbind section contents 16

I could either add notarget: *-*-solaris2* to those or (seems to make
more sense to me) just change

#xfail: ![supports_gnu_osabi]

to notarget (if that works).

Tested on x86_64-pc-solaris2.11, i386-pc-solaris2.11,
x86_64-pc-linux-gnu, and i686-pc-linux-gnu.

        Rainer

--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2020-04-01  Rainer Orth  <[hidden email]>

        ld:
        * testsuite/ld-ifunc/ifunc-10-i386.d: Remove *-*-solaris2* from
        notarget.
        * ifunc-11-i386.d: Likewise.
        * ifunc-12-i386.d: Likewise.
        * ifunc-13-i386.d: Likewise.
        * ifunc-14a-i386.d: Likewise.
        * ifunc-14b-i386.d: Likewise.
        * ifunc-14c-i386.d: Likewise.
        * ifunc-14d-i386.d: Likewise.
        * ifunc-14e-i386.d: Likewise.
        * ifunc-14f-i386.d: Likewise.
        * ifunc-15-i386.d: Likewise.
        * ifunc-16-i386-now.d: Likewise.
        * ifunc-16-i386.d: Likewise.
        * ifunc-17a-i386.d: Likewise.
        * ifunc-17b-i386.d: Likewise.
        * ifunc-18a-i386.d: Likewise.
        * ifunc-18b-i386.d: Likewise.
        * ifunc-19a-i386.d: Likewise.
        * ifunc-19b-i386.d: Likewise.
        * ifunc-2-i386-now.d: Likewise.
        * ifunc-2-i386.d: Likewise.
        * ifunc-2-local-i386-now.d: Likewise.
        * ifunc-2-local-i386.d: Likewise.
        * ifunc-20-i386.d: Likewise.
        * ifunc-21-i386.d: Likewise.
        * ifunc-22-i386.d: Likewise.
        * ifunc-5a-i386.d: Likewise.
        * ifunc-5a-local-i386.d: Likewise.
        * ifunc-5b-i386.d: Likewise.
        * ifunc-5b-local-i386.d: Likewise.
        * ifunc-5r-local-i386.d: Likewise.
        * ifunc-6a-i386.d: Likewise.
        * ifunc-6b-i386.d: Likewise.
        * ifunc-7a-i386.d: Likewise.
        * ifunc-7b-i386.d: Likewise.
        * ifunc-8-i386.d: Likewise.
        * ifunc-9-i386.d: Likewise.
        * pr17154-i386-now.d: Likewise.
        * pr17154-i386.d: Likewise.

        * ifunc-23a-x86.d: Remove notarget.
        * ifunc-24a-x86.d: Likewise.
        * ifunc-25a-x86.d: Likewise.

        binutils:
        * testsuite/lib/binutils-common.exp (supports_gnu_osabi): Don't
        enable on *-*-solaris*.


# HG changeset patch
# Parent  1e5b3bca7b34c0413b4d80e4f6aaa3ebbfd58f65
ld: Disable ifunc tests on Solaris

diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -201,8 +201,7 @@ proc supports_gnu_osabi {} {
  || ( [istarget *-*-nto*] && ![istarget arm*-*-*] )
  || [istarget *-*-irix*]
  || [istarget *-*-*eabi*]
- || [istarget *-*-rtems*]
- || [istarget *-*-solaris*] } {
+ || [istarget *-*-rtems*] } {
  return 1
     }
     if { [istarget "wasm32*-*-*"] } {
diff --git a/ld/testsuite/ld-ifunc/ifunc-10-i386.d b/ld/testsuite/ld-ifunc/ifunc-10-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-10-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-10-i386.d
@@ -2,6 +2,6 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 There are no relocations in this file.
diff --git a/ld/testsuite/ld-ifunc/ifunc-11-i386.d b/ld/testsuite/ld-ifunc/ifunc-11-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-11-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-11-i386.d
@@ -2,6 +2,6 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 There are no relocations in this file.
diff --git a/ld/testsuite/ld-ifunc/ifunc-12-i386.d b/ld/testsuite/ld-ifunc/ifunc-12-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-12-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-12-i386.d
@@ -2,6 +2,6 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 There are no relocations in this file.
diff --git a/ld/testsuite/ld-ifunc/ifunc-13-i386.d b/ld/testsuite/ld-ifunc/ifunc-13-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-13-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-13-i386.d
@@ -4,7 +4,7 @@
 #as: --32 -mrelax-relocations=yes
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.ifunc' at offset 0x[0-9a-f]+ contains 1 entry:
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-14a-i386.d b/ld/testsuite/ld-ifunc/ifunc-14a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-14a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-14a-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -d --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #failif
 #...
diff --git a/ld/testsuite/ld-ifunc/ifunc-14b-i386.d b/ld/testsuite/ld-ifunc/ifunc-14b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-14b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-14b-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -d --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #failif
 #...
diff --git a/ld/testsuite/ld-ifunc/ifunc-14c-i386.d b/ld/testsuite/ld-ifunc/ifunc-14c-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-14c-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-14c-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #failif
 #...
diff --git a/ld/testsuite/ld-ifunc/ifunc-14d-i386.d b/ld/testsuite/ld-ifunc/ifunc-14d-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-14d-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-14d-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #failif
 #...
diff --git a/ld/testsuite/ld-ifunc/ifunc-14e-i386.d b/ld/testsuite/ld-ifunc/ifunc-14e-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-14e-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-14e-i386.d
@@ -5,7 +5,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #failif
 #...
diff --git a/ld/testsuite/ld-ifunc/ifunc-14f-i386.d b/ld/testsuite/ld-ifunc/ifunc-14f-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-14f-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-14f-i386.d
@@ -5,7 +5,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #failif
 #...
diff --git a/ld/testsuite/ld-ifunc/ifunc-15-i386.d b/ld/testsuite/ld-ifunc/ifunc-15-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-15-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-15-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.got' at offset 0x[0-9a-f]+ contains 1 entry:
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-16-i386-now.d b/ld/testsuite/ld-ifunc/ifunc-16-i386-now.d
--- a/ld/testsuite/ld-ifunc/ifunc-16-i386-now.d
+++ b/ld/testsuite/ld-ifunc/ifunc-16-i386-now.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-16-i386.d b/ld/testsuite/ld-ifunc/ifunc-16-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-16-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-16-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-17a-i386.d b/ld/testsuite/ld-ifunc/ifunc-17a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-17a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-17a-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -s --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #...
  +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
diff --git a/ld/testsuite/ld-ifunc/ifunc-17b-i386.d b/ld/testsuite/ld-ifunc/ifunc-17b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-17b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-17b-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -s --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #...
  +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo
diff --git a/ld/testsuite/ld-ifunc/ifunc-18a-i386.d b/ld/testsuite/ld-ifunc/ifunc-18a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-18a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-18a-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.ifunc' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-18b-i386.d b/ld/testsuite/ld-ifunc/ifunc-18b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-18b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-18b-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.ifunc' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-19a-i386.d b/ld/testsuite/ld-ifunc/ifunc-19a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-19a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-19a-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.ifunc' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-19b-i386.d b/ld/testsuite/ld-ifunc/ifunc-19b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-19b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-19b-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.ifunc' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-2-i386-now.d b/ld/testsuite/ld-ifunc/ifunc-2-i386-now.d
--- a/ld/testsuite/ld-ifunc/ifunc-2-i386-now.d
+++ b/ld/testsuite/ld-ifunc/ifunc-2-i386-now.d
@@ -3,7 +3,7 @@
 #as: --32
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 .*: +file format .*
 
diff --git a/ld/testsuite/ld-ifunc/ifunc-2-i386.d b/ld/testsuite/ld-ifunc/ifunc-2-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-2-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-2-i386.d
@@ -2,7 +2,7 @@
 #as: --32
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #...
 [ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-f]+<\*ABS\*@plt>
diff --git a/ld/testsuite/ld-ifunc/ifunc-2-local-i386-now.d b/ld/testsuite/ld-ifunc/ifunc-2-local-i386-now.d
--- a/ld/testsuite/ld-ifunc/ifunc-2-local-i386-now.d
+++ b/ld/testsuite/ld-ifunc/ifunc-2-local-i386-now.d
@@ -3,7 +3,7 @@
 #as: --32
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 .*: +file format .*
 
diff --git a/ld/testsuite/ld-ifunc/ifunc-2-local-i386.d b/ld/testsuite/ld-ifunc/ifunc-2-local-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-2-local-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-2-local-i386.d
@@ -2,7 +2,7 @@
 #as: --32
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #...
 [ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-f]+<\*ABS\*@plt>
diff --git a/ld/testsuite/ld-ifunc/ifunc-20-i386.d b/ld/testsuite/ld-ifunc/ifunc-20-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-20-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-20-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.ifunc' at offset 0x[0-9a-f]+ contains 1 entry:
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-21-i386.d b/ld/testsuite/ld-ifunc/ifunc-21-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-21-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-21-i386.d
@@ -2,7 +2,7 @@
 #as: --32 -mrelax-relocations=yes
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 .*: +file format .*
 
diff --git a/ld/testsuite/ld-ifunc/ifunc-22-i386.d b/ld/testsuite/ld-ifunc/ifunc-22-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-22-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-22-i386.d
@@ -2,7 +2,7 @@
 #as: --32 -mrelax-relocations=yes
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 .*: +file format .*
 
diff --git a/ld/testsuite/ld-ifunc/ifunc-23a-x86.d b/ld/testsuite/ld-ifunc/ifunc-23a-x86.d
--- a/ld/testsuite/ld-ifunc/ifunc-23a-x86.d
+++ b/ld/testsuite/ld-ifunc/ifunc-23a-x86.d
@@ -2,7 +2,6 @@
 #ld:
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-solaris*
 
 Relocation section '.rel(a|).plt' at offset 0x[0-9a-f]+ contains 1 entry:
  +Offset +Info +Type +Sym.* Value +Symbol's Name.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-24a-x86.d b/ld/testsuite/ld-ifunc/ifunc-24a-x86.d
--- a/ld/testsuite/ld-ifunc/ifunc-24a-x86.d
+++ b/ld/testsuite/ld-ifunc/ifunc-24a-x86.d
@@ -2,7 +2,6 @@
 #ld:
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-solaris*
 
 Relocation section '.rel(a|).plt' at offset 0x[0-9a-f]+ contains 1 entry:
  +Offset +Info +Type +Sym.* Value +Symbol's Name.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-25a-x86.d b/ld/testsuite/ld-ifunc/ifunc-25a-x86.d
--- a/ld/testsuite/ld-ifunc/ifunc-25a-x86.d
+++ b/ld/testsuite/ld-ifunc/ifunc-25a-x86.d
@@ -2,7 +2,6 @@
 #ld:
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-solaris*
 
 Relocation section '.rel(a|).plt' at offset 0x[0-9a-f]+ contains 1 entry:
  +Offset +Info +Type +Sym.* Value +Symbol's Name.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-5a-i386.d b/ld/testsuite/ld-ifunc/ifunc-5a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-5a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5a-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-5a-local-i386.d b/ld/testsuite/ld-ifunc/ifunc-5a-local-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-5a-local-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5a-local-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-5b-i386.d b/ld/testsuite/ld-ifunc/ifunc-5b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-5b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5b-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.got' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-5b-local-i386.d b/ld/testsuite/ld-ifunc/ifunc-5b-local-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-5b-local-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5b-local-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-5r-local-i386.d b/ld/testsuite/ld-ifunc/ifunc-5r-local-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-5r-local-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-5r-local-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.text' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-6a-i386.d b/ld/testsuite/ld-ifunc/ifunc-6a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-6a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-6a-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-6b-i386.d b/ld/testsuite/ld-ifunc/ifunc-6b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-6b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-6b-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.got' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-7a-i386.d b/ld/testsuite/ld-ifunc/ifunc-7a-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-7a-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-7a-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-7b-i386.d b/ld/testsuite/ld-ifunc/ifunc-7b-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-7b-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-7b-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-8-i386.d b/ld/testsuite/ld-ifunc/ifunc-8-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-8-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-8-i386.d
@@ -4,7 +4,7 @@
 #as: --32
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/ifunc-9-i386.d b/ld/testsuite/ld-ifunc/ifunc-9-i386.d
--- a/ld/testsuite/ld-ifunc/ifunc-9-i386.d
+++ b/ld/testsuite/ld-ifunc/ifunc-9-i386.d
@@ -3,7 +3,7 @@
 #ld: -m elf_i386 --export-dynamic
 #readelf: -r --wide
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 Relocation section '.rel.plt' at .*
 [ ]+Offset[ ]+Info[ ]+Type[ ]+.*
diff --git a/ld/testsuite/ld-ifunc/pr17154-i386-now.d b/ld/testsuite/ld-ifunc/pr17154-i386-now.d
--- a/ld/testsuite/ld-ifunc/pr17154-i386-now.d
+++ b/ld/testsuite/ld-ifunc/pr17154-i386-now.d
@@ -3,7 +3,7 @@
 #as: --32
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 .*: +file format .*
 
diff --git a/ld/testsuite/ld-ifunc/pr17154-i386.d b/ld/testsuite/ld-ifunc/pr17154-i386.d
--- a/ld/testsuite/ld-ifunc/pr17154-i386.d
+++ b/ld/testsuite/ld-ifunc/pr17154-i386.d
@@ -3,7 +3,7 @@
 #as: --32
 #objdump: -dw
 #target: x86_64-*-* i?86-*-*
-#notarget: *-*-lynxos *-*-nacl* *-*-nto* *-*-solaris2*
+#notarget: *-*-lynxos *-*-nacl* *-*-nto*
 
 #...
 0+180 <.*>:
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] ld: Disable ifunc tests on Solaris

Sourceware - binutils list mailing list
On Wed, Apr 1, 2020 at 4:16 AM Rainer Orth <[hidden email]> wrote:

>
> A couple of ld ifunc tests currently FAIL on 64-bit Solaris/x86:
>
> FAIL: ld-ifunc/ifunc-10-x86-64
> FAIL: ld-ifunc/ifunc-11-x86-64
> FAIL: ld-ifunc/ifunc-12-x86-64
> FAIL: ld-ifunc/ifunc-13-x86-64
> FAIL: ld-ifunc/ifunc-14a-x86-64
> FAIL: ld-ifunc/ifunc-14b-x86-64
> FAIL: ld-ifunc/ifunc-14c-x86-64
> FAIL: ld-ifunc/ifunc-14d-x86-64
> FAIL: ld-ifunc/ifunc-14e-x86-64
> FAIL: ld-ifunc/ifunc-14f-x86-64
> FAIL: ld-ifunc/ifunc-15-x86-64
> FAIL: ld-ifunc/ifunc-17a-x86-64
> FAIL: ld-ifunc/ifunc-17b-x86-64
> FAIL: ld-ifunc/ifunc-2-local-x86-64-now
> FAIL: ld-ifunc/ifunc-2-local-x86-64
> FAIL: ld-ifunc/ifunc-2-x86-64-now
> FAIL: ld-ifunc/ifunc-2-x86-64
> FAIL: ld-ifunc/ifunc-20-x86-64
> FAIL: ld-ifunc/pr17154-x86-64-now
> FAIL: ld-ifunc/pr17154-x86-64
>
> For one, the actuall error is weird:
>
> ./ld-new: target elf64-x86-64 not found
> failed with: <./ld-new: target elf64-x86-64 not found>, no expected output
> FAIL: ld-ifunc/ifunc-10-x86-64
>
> although ld -V does report the elf_x86_64 emulation as supported:
>
> $ ./ld/ld-new -V
> GNU ld (GNU Binutils) 2.34.50.20200328
>   Supported emulations:
>    elf_x86_64_sol2
>    elf_x86_64
> [...]
>
> When using ld -m elf_x86_64_sol2 instead, one of the testcases links
> successfully.
>
> However, there's no point in pursuing this: Solaris does not support
> ifunc, as can be seen in <sys/elf.h>:
>
> /*
>  * GNU/Linux specific symbol type not used by Solaris
>  */
> #define STT_GNU_IFUNC   10
>
> and never will, given that it has symbol capabilities as solution to
> effectively the same problem:
>
> http://www.linker-aliens.org/blogs/rie/entry/symbol_capabilitie/
>
> Therefore I'd like to disable ifunc testing on Solaris completely.
> There are two possible solutions:
>
> * Explicitly reject Solaris in ld/testsuite/ld-ifunc/ifunc.exp.
>
> * Remove Solaris from binutils/testsuite/lib/binutils-common.exp
>   (supports_gnu_osabi).  The comment there seems confusing:
>
> # True if the ELF target supports setting the ELF header OSABI field
> # to ELFOSABI_GNU or ELFOSABI_FREEBSD, a requirement for STT_GNU_IFUNC
> # symbol and SHF_GNU_MBIND section support.
>
>   Why wouldn't one be able to set the OSABI field?  It's a file after
>   all ;-)  Isn't the question if the extensions covered by ELFOSABI_GNU
>   are handled at runtime?
>
>   Whatever the case, it seems right to disable this on Solaris: the
>   ifunc part is covered above.  SHF_GNU_MBIND is in the OS-specific
>   range and conflicts with
>
> #define SHF_SUNW_REALLOC        0x01000000      /* internal: krtld realloc */
>
>   While the comment suggests this might be relocatable without too much
>   problems, the description of mbind (no formal spec AFAICS, just the
>   comment in the binutils patch submission) strongly suggests that this
>   isn't relevant to Solaris at all.
>
>   Indirectly, clearing supports_gnu_osabi on Solaris disables
>   supports_gnu_unique.  Again, Solaris <sys/elf.h> has
>
> /*
>  * GNU/Linux specific binding not used by Solaris
>  */
> #define STB_GNU_UNIQUE  10
>
>   so this seems the right thing to do.
>
> * Either way, one can remove the explicit mentions of *-*-solaris2* in
>   quite a number of (but not all) the ld-ifunc dump file notarget lists.
>   I suspect a similar solution is possible for the other targets
>   routinely listed there (*-*-lynxos *-*-nacl* *-*-nto*), but I know
>   nothing about those and will thus leave them alone.
>
> I went for the supports_gnu_osabi solution, but there's one fallout: two
> gas tests now XPASS because the are xfail'ed for !supports_gnu_osabi:
>
> XPASS: mbind sections 12
> XPASS: mbind section contents 16
> XPASS: mbind sections 16
> XPASS: mbind section contents 16
>
> I could either add notarget: *-*-solaris2* to those or (seems to make
> more sense to me) just change
>
> #xfail: ![supports_gnu_osabi]
>
> to notarget (if that works).
>
> Tested on x86_64-pc-solaris2.11, i386-pc-solaris2.11,
> x86_64-pc-linux-gnu, and i686-pc-linux-gnu.
>
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
> 2020-04-01  Rainer Orth  <[hidden email]>
>
>         ld:
>         * testsuite/ld-ifunc/ifunc-10-i386.d: Remove *-*-solaris2* from
>         notarget.
>         * ifunc-11-i386.d: Likewise.
>         * ifunc-12-i386.d: Likewise.
>         * ifunc-13-i386.d: Likewise.
>         * ifunc-14a-i386.d: Likewise.
>         * ifunc-14b-i386.d: Likewise.
>         * ifunc-14c-i386.d: Likewise.
>         * ifunc-14d-i386.d: Likewise.
>         * ifunc-14e-i386.d: Likewise.
>         * ifunc-14f-i386.d: Likewise.
>         * ifunc-15-i386.d: Likewise.
>         * ifunc-16-i386-now.d: Likewise.
>         * ifunc-16-i386.d: Likewise.
>         * ifunc-17a-i386.d: Likewise.
>         * ifunc-17b-i386.d: Likewise.
>         * ifunc-18a-i386.d: Likewise.
>         * ifunc-18b-i386.d: Likewise.
>         * ifunc-19a-i386.d: Likewise.
>         * ifunc-19b-i386.d: Likewise.
>         * ifunc-2-i386-now.d: Likewise.
>         * ifunc-2-i386.d: Likewise.
>         * ifunc-2-local-i386-now.d: Likewise.
>         * ifunc-2-local-i386.d: Likewise.
>         * ifunc-20-i386.d: Likewise.
>         * ifunc-21-i386.d: Likewise.
>         * ifunc-22-i386.d: Likewise.
>         * ifunc-5a-i386.d: Likewise.
>         * ifunc-5a-local-i386.d: Likewise.
>         * ifunc-5b-i386.d: Likewise.
>         * ifunc-5b-local-i386.d: Likewise.
>         * ifunc-5r-local-i386.d: Likewise.
>         * ifunc-6a-i386.d: Likewise.
>         * ifunc-6b-i386.d: Likewise.
>         * ifunc-7a-i386.d: Likewise.
>         * ifunc-7b-i386.d: Likewise.
>         * ifunc-8-i386.d: Likewise.
>         * ifunc-9-i386.d: Likewise.
>         * pr17154-i386-now.d: Likewise.
>         * pr17154-i386.d: Likewise.
>
>         * ifunc-23a-x86.d: Remove notarget.
>         * ifunc-24a-x86.d: Likewise.
>         * ifunc-25a-x86.d: Likewise.

The above is OK.

>         binutils:
>         * testsuite/lib/binutils-common.exp (supports_gnu_osabi): Don't
>         enable on *-*-solaris*.
>

This makes senses to me.  Since you are Solaris owner, I think it is OK.

Thanks.

--
H.J.
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] ld: Disable ifunc tests on Solaris

Rainer Orth-2
Hi H.J.,

> On Wed, Apr 1, 2020 at 4:16 AM Rainer Orth <[hidden email]> wrote:
>>
>> A couple of ld ifunc tests currently FAIL on 64-bit Solaris/x86:
>>
>> FAIL: ld-ifunc/ifunc-10-x86-64
>> FAIL: ld-ifunc/ifunc-11-x86-64
>> FAIL: ld-ifunc/ifunc-12-x86-64
>> FAIL: ld-ifunc/ifunc-13-x86-64
>> FAIL: ld-ifunc/ifunc-14a-x86-64
>> FAIL: ld-ifunc/ifunc-14b-x86-64
>> FAIL: ld-ifunc/ifunc-14c-x86-64
>> FAIL: ld-ifunc/ifunc-14d-x86-64
>> FAIL: ld-ifunc/ifunc-14e-x86-64
>> FAIL: ld-ifunc/ifunc-14f-x86-64
>> FAIL: ld-ifunc/ifunc-15-x86-64
>> FAIL: ld-ifunc/ifunc-17a-x86-64
>> FAIL: ld-ifunc/ifunc-17b-x86-64
>> FAIL: ld-ifunc/ifunc-2-local-x86-64-now
>> FAIL: ld-ifunc/ifunc-2-local-x86-64
>> FAIL: ld-ifunc/ifunc-2-x86-64-now
>> FAIL: ld-ifunc/ifunc-2-x86-64
>> FAIL: ld-ifunc/ifunc-20-x86-64
>> FAIL: ld-ifunc/pr17154-x86-64-now
>> FAIL: ld-ifunc/pr17154-x86-64
>>
>> For one, the actuall error is weird:
>>
>> ./ld-new: target elf64-x86-64 not found
>> failed with: <./ld-new: target elf64-x86-64 not found>, no expected output
>> FAIL: ld-ifunc/ifunc-10-x86-64
>>
>> although ld -V does report the elf_x86_64 emulation as supported:
>>
>> $ ./ld/ld-new -V
>> GNU ld (GNU Binutils) 2.34.50.20200328
>>   Supported emulations:
>>    elf_x86_64_sol2
>>    elf_x86_64
>> [...]
>>
>> When using ld -m elf_x86_64_sol2 instead, one of the testcases links
>> successfully.
>>
>> However, there's no point in pursuing this: Solaris does not support
>> ifunc, as can be seen in <sys/elf.h>:
>>
>> /*
>>  * GNU/Linux specific symbol type not used by Solaris
>>  */
>> #define STT_GNU_IFUNC   10
>>
>> and never will, given that it has symbol capabilities as solution to
>> effectively the same problem:
>>
>> http://www.linker-aliens.org/blogs/rie/entry/symbol_capabilitie/
>>
>> Therefore I'd like to disable ifunc testing on Solaris completely.
>> There are two possible solutions:
>>
>> * Explicitly reject Solaris in ld/testsuite/ld-ifunc/ifunc.exp.
>>
>> * Remove Solaris from binutils/testsuite/lib/binutils-common.exp
>>   (supports_gnu_osabi).  The comment there seems confusing:
>>
>> # True if the ELF target supports setting the ELF header OSABI field
>> # to ELFOSABI_GNU or ELFOSABI_FREEBSD, a requirement for STT_GNU_IFUNC
>> # symbol and SHF_GNU_MBIND section support.
>>
>>   Why wouldn't one be able to set the OSABI field?  It's a file after
>>   all ;-)  Isn't the question if the extensions covered by ELFOSABI_GNU
>>   are handled at runtime?
>>
>>   Whatever the case, it seems right to disable this on Solaris: the
>>   ifunc part is covered above.  SHF_GNU_MBIND is in the OS-specific
>>   range and conflicts with
>>
>> #define SHF_SUNW_REALLOC        0x01000000      /* internal: krtld realloc */
>>
>>   While the comment suggests this might be relocatable without too much
>>   problems, the description of mbind (no formal spec AFAICS, just the
>>   comment in the binutils patch submission) strongly suggests that this
>>   isn't relevant to Solaris at all.
>>
>>   Indirectly, clearing supports_gnu_osabi on Solaris disables
>>   supports_gnu_unique.  Again, Solaris <sys/elf.h> has
>>
>> /*
>>  * GNU/Linux specific binding not used by Solaris
>>  */
>> #define STB_GNU_UNIQUE  10
>>
>>   so this seems the right thing to do.
>>
>> * Either way, one can remove the explicit mentions of *-*-solaris2* in
>>   quite a number of (but not all) the ld-ifunc dump file notarget lists.
>>   I suspect a similar solution is possible for the other targets
>>   routinely listed there (*-*-lynxos *-*-nacl* *-*-nto*), but I know
>>   nothing about those and will thus leave them alone.
>>
>> I went for the supports_gnu_osabi solution, but there's one fallout: two
>> gas tests now XPASS because the are xfail'ed for !supports_gnu_osabi:
>>
>> XPASS: mbind sections 12
>> XPASS: mbind section contents 16
>> XPASS: mbind sections 16
>> XPASS: mbind section contents 16
>>
>> I could either add notarget: *-*-solaris2* to those or (seems to make
>> more sense to me) just change
>>
>> #xfail: ![supports_gnu_osabi]
>>
>> to notarget (if that works).
>>
>> Tested on x86_64-pc-solaris2.11, i386-pc-solaris2.11,
>> x86_64-pc-linux-gnu, and i686-pc-linux-gnu.
>>
>>         Rainer
>>
>> --
>> -----------------------------------------------------------------------------
>> Rainer Orth, Center for Biotechnology, Bielefeld University
>>
>>
>> 2020-04-01  Rainer Orth  <[hidden email]>
>>
>>         ld:
>>         * testsuite/ld-ifunc/ifunc-10-i386.d: Remove *-*-solaris2* from
>>         notarget.
>>         * ifunc-11-i386.d: Likewise.
>>         * ifunc-12-i386.d: Likewise.
>>         * ifunc-13-i386.d: Likewise.
>>         * ifunc-14a-i386.d: Likewise.
>>         * ifunc-14b-i386.d: Likewise.
>>         * ifunc-14c-i386.d: Likewise.
>>         * ifunc-14d-i386.d: Likewise.
>>         * ifunc-14e-i386.d: Likewise.
>>         * ifunc-14f-i386.d: Likewise.
>>         * ifunc-15-i386.d: Likewise.
>>         * ifunc-16-i386-now.d: Likewise.
>>         * ifunc-16-i386.d: Likewise.
>>         * ifunc-17a-i386.d: Likewise.
>>         * ifunc-17b-i386.d: Likewise.
>>         * ifunc-18a-i386.d: Likewise.
>>         * ifunc-18b-i386.d: Likewise.
>>         * ifunc-19a-i386.d: Likewise.
>>         * ifunc-19b-i386.d: Likewise.
>>         * ifunc-2-i386-now.d: Likewise.
>>         * ifunc-2-i386.d: Likewise.
>>         * ifunc-2-local-i386-now.d: Likewise.
>>         * ifunc-2-local-i386.d: Likewise.
>>         * ifunc-20-i386.d: Likewise.
>>         * ifunc-21-i386.d: Likewise.
>>         * ifunc-22-i386.d: Likewise.
>>         * ifunc-5a-i386.d: Likewise.
>>         * ifunc-5a-local-i386.d: Likewise.
>>         * ifunc-5b-i386.d: Likewise.
>>         * ifunc-5b-local-i386.d: Likewise.
>>         * ifunc-5r-local-i386.d: Likewise.
>>         * ifunc-6a-i386.d: Likewise.
>>         * ifunc-6b-i386.d: Likewise.
>>         * ifunc-7a-i386.d: Likewise.
>>         * ifunc-7b-i386.d: Likewise.
>>         * ifunc-8-i386.d: Likewise.
>>         * ifunc-9-i386.d: Likewise.
>>         * pr17154-i386-now.d: Likewise.
>>         * pr17154-i386.d: Likewise.
>>
>>         * ifunc-23a-x86.d: Remove notarget.
>>         * ifunc-24a-x86.d: Likewise.
>>         * ifunc-25a-x86.d: Likewise.
>
> The above is OK.
thanks.

>>         binutils:
>>         * testsuite/lib/binutils-common.exp (supports_gnu_osabi): Don't
>>         enable on *-*-solaris*.
>>
>
> This makes senses to me.  Since you are Solaris owner, I think it is OK.

Except that I'm not ;-)  Even so, there remains the matter of the gas
tests XPASSing now.  I've since verified that the attached patchlet
works, making the affected tests UNSUPPORTED.  This change affects
non-Solaris targets, too, of course.

Is this ok, together with the binutils-common.exp change?

Thanks.
        Rainer

--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


        gas:
        * testsuite/gas/elf/section12a.d: Use notarget instead of xfail.
        * testsuite/gas/elf/section12b.d: Likewise.
        * testsuite/gas/elf/section16a.d: Likewise.
        * testsuite/gas/elf/section16b.d: Likewise.


diff --git a/gas/testsuite/gas/elf/section12a.d b/gas/testsuite/gas/elf/section12a.d
--- a/gas/testsuite/gas/elf/section12a.d
+++ b/gas/testsuite/gas/elf/section12a.d
@@ -3,7 +3,7 @@
 #readelf: -Sg --wide
 #name: mbind sections 12
 # A number of targets do not support SHF_GNU_MBIND
-#xfail: ![supports_gnu_osabi]
+#notarget: ![supports_gnu_osabi]
 
 #...
   \[[ 0-9]+\] \.mbind\.data[ ]+PROGBITS[ ]+0+0 0+[0-9a-f]+ 0+1 00 WAD  0   0  1
diff --git a/gas/testsuite/gas/elf/section12b.d b/gas/testsuite/gas/elf/section12b.d
--- a/gas/testsuite/gas/elf/section12b.d
+++ b/gas/testsuite/gas/elf/section12b.d
@@ -6,7 +6,7 @@
 # expected below.
 #xfail: rx-*-*
 # A number of targets do not support SHF_GNU_MBIND
-#xfail: ![supports_gnu_osabi]
+#notarget: ![supports_gnu_osabi]
 
 #...
 Contents of section .mbind.data:
diff --git a/gas/testsuite/gas/elf/section16a.d b/gas/testsuite/gas/elf/section16a.d
--- a/gas/testsuite/gas/elf/section16a.d
+++ b/gas/testsuite/gas/elf/section16a.d
@@ -3,7 +3,7 @@
 #readelf: -Sg --wide
 #name: mbind sections 16
 # A number of targets do not support SHF_GNU_MBIND
-#xfail: ![supports_gnu_osabi]
+#notarget: ![supports_gnu_osabi]
 
 #...
   \[[ 0-9]+\] \.mbind\.data[ ]+PROGBITS[ ]+0+0 0+[0-9a-f]+ 0+1 00 WAD  0   0  1
diff --git a/gas/testsuite/gas/elf/section16b.d b/gas/testsuite/gas/elf/section16b.d
--- a/gas/testsuite/gas/elf/section16b.d
+++ b/gas/testsuite/gas/elf/section16b.d
@@ -6,7 +6,7 @@
 # expected below.
 #xfail: rx-*-*
 # A number of targets do not support SHF_GNU_MBIND
-#xfail: ![supports_gnu_osabi]
+#notarget: ![supports_gnu_osabi]
 
 #...
 Contents of section .mbind.data:
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] ld: Disable ifunc tests on Solaris

Sourceware - binutils list mailing list
On Wed, Apr 1, 2020 at 6:46 AM Rainer Orth <[hidden email]> wrote:

>
> Hi H.J.,
>
> > On Wed, Apr 1, 2020 at 4:16 AM Rainer Orth <[hidden email]> wrote:
> >>
> >> A couple of ld ifunc tests currently FAIL on 64-bit Solaris/x86:
> >>
> >> FAIL: ld-ifunc/ifunc-10-x86-64
> >> FAIL: ld-ifunc/ifunc-11-x86-64
> >> FAIL: ld-ifunc/ifunc-12-x86-64
> >> FAIL: ld-ifunc/ifunc-13-x86-64
> >> FAIL: ld-ifunc/ifunc-14a-x86-64
> >> FAIL: ld-ifunc/ifunc-14b-x86-64
> >> FAIL: ld-ifunc/ifunc-14c-x86-64
> >> FAIL: ld-ifunc/ifunc-14d-x86-64
> >> FAIL: ld-ifunc/ifunc-14e-x86-64
> >> FAIL: ld-ifunc/ifunc-14f-x86-64
> >> FAIL: ld-ifunc/ifunc-15-x86-64
> >> FAIL: ld-ifunc/ifunc-17a-x86-64
> >> FAIL: ld-ifunc/ifunc-17b-x86-64
> >> FAIL: ld-ifunc/ifunc-2-local-x86-64-now
> >> FAIL: ld-ifunc/ifunc-2-local-x86-64
> >> FAIL: ld-ifunc/ifunc-2-x86-64-now
> >> FAIL: ld-ifunc/ifunc-2-x86-64
> >> FAIL: ld-ifunc/ifunc-20-x86-64
> >> FAIL: ld-ifunc/pr17154-x86-64-now
> >> FAIL: ld-ifunc/pr17154-x86-64
> >>
> >> For one, the actuall error is weird:
> >>
> >> ./ld-new: target elf64-x86-64 not found
> >> failed with: <./ld-new: target elf64-x86-64 not found>, no expected output
> >> FAIL: ld-ifunc/ifunc-10-x86-64
> >>
> >> although ld -V does report the elf_x86_64 emulation as supported:
> >>
> >> $ ./ld/ld-new -V
> >> GNU ld (GNU Binutils) 2.34.50.20200328
> >>   Supported emulations:
> >>    elf_x86_64_sol2
> >>    elf_x86_64
> >> [...]
> >>
> >> When using ld -m elf_x86_64_sol2 instead, one of the testcases links
> >> successfully.
> >>
> >> However, there's no point in pursuing this: Solaris does not support
> >> ifunc, as can be seen in <sys/elf.h>:
> >>
> >> /*
> >>  * GNU/Linux specific symbol type not used by Solaris
> >>  */
> >> #define STT_GNU_IFUNC   10
> >>
> >> and never will, given that it has symbol capabilities as solution to
> >> effectively the same problem:
> >>
> >> http://www.linker-aliens.org/blogs/rie/entry/symbol_capabilitie/
> >>
> >> Therefore I'd like to disable ifunc testing on Solaris completely.
> >> There are two possible solutions:
> >>
> >> * Explicitly reject Solaris in ld/testsuite/ld-ifunc/ifunc.exp.
> >>
> >> * Remove Solaris from binutils/testsuite/lib/binutils-common.exp
> >>   (supports_gnu_osabi).  The comment there seems confusing:
> >>
> >> # True if the ELF target supports setting the ELF header OSABI field
> >> # to ELFOSABI_GNU or ELFOSABI_FREEBSD, a requirement for STT_GNU_IFUNC
> >> # symbol and SHF_GNU_MBIND section support.
> >>
> >>   Why wouldn't one be able to set the OSABI field?  It's a file after
> >>   all ;-)  Isn't the question if the extensions covered by ELFOSABI_GNU
> >>   are handled at runtime?
> >>
> >>   Whatever the case, it seems right to disable this on Solaris: the
> >>   ifunc part is covered above.  SHF_GNU_MBIND is in the OS-specific
> >>   range and conflicts with
> >>
> >> #define SHF_SUNW_REALLOC        0x01000000      /* internal: krtld realloc */
> >>
> >>   While the comment suggests this might be relocatable without too much
> >>   problems, the description of mbind (no formal spec AFAICS, just the
> >>   comment in the binutils patch submission) strongly suggests that this
> >>   isn't relevant to Solaris at all.
> >>
> >>   Indirectly, clearing supports_gnu_osabi on Solaris disables
> >>   supports_gnu_unique.  Again, Solaris <sys/elf.h> has
> >>
> >> /*
> >>  * GNU/Linux specific binding not used by Solaris
> >>  */
> >> #define STB_GNU_UNIQUE  10
> >>
> >>   so this seems the right thing to do.
> >>
> >> * Either way, one can remove the explicit mentions of *-*-solaris2* in
> >>   quite a number of (but not all) the ld-ifunc dump file notarget lists.
> >>   I suspect a similar solution is possible for the other targets
> >>   routinely listed there (*-*-lynxos *-*-nacl* *-*-nto*), but I know
> >>   nothing about those and will thus leave them alone.
> >>
> >> I went for the supports_gnu_osabi solution, but there's one fallout: two
> >> gas tests now XPASS because the are xfail'ed for !supports_gnu_osabi:
> >>
> >> XPASS: mbind sections 12
> >> XPASS: mbind section contents 16
> >> XPASS: mbind sections 16
> >> XPASS: mbind section contents 16
> >>
> >> I could either add notarget: *-*-solaris2* to those or (seems to make
> >> more sense to me) just change
> >>
> >> #xfail: ![supports_gnu_osabi]
> >>
> >> to notarget (if that works).
> >>
> >> Tested on x86_64-pc-solaris2.11, i386-pc-solaris2.11,
> >> x86_64-pc-linux-gnu, and i686-pc-linux-gnu.
> >>
> >>         Rainer
> >>
> >> --
> >> -----------------------------------------------------------------------------
> >> Rainer Orth, Center for Biotechnology, Bielefeld University
> >>
> >>
> >> 2020-04-01  Rainer Orth  <[hidden email]>
> >>
> >>         ld:
> >>         * testsuite/ld-ifunc/ifunc-10-i386.d: Remove *-*-solaris2* from
> >>         notarget.
> >>         * ifunc-11-i386.d: Likewise.
> >>         * ifunc-12-i386.d: Likewise.
> >>         * ifunc-13-i386.d: Likewise.
> >>         * ifunc-14a-i386.d: Likewise.
> >>         * ifunc-14b-i386.d: Likewise.
> >>         * ifunc-14c-i386.d: Likewise.
> >>         * ifunc-14d-i386.d: Likewise.
> >>         * ifunc-14e-i386.d: Likewise.
> >>         * ifunc-14f-i386.d: Likewise.
> >>         * ifunc-15-i386.d: Likewise.
> >>         * ifunc-16-i386-now.d: Likewise.
> >>         * ifunc-16-i386.d: Likewise.
> >>         * ifunc-17a-i386.d: Likewise.
> >>         * ifunc-17b-i386.d: Likewise.
> >>         * ifunc-18a-i386.d: Likewise.
> >>         * ifunc-18b-i386.d: Likewise.
> >>         * ifunc-19a-i386.d: Likewise.
> >>         * ifunc-19b-i386.d: Likewise.
> >>         * ifunc-2-i386-now.d: Likewise.
> >>         * ifunc-2-i386.d: Likewise.
> >>         * ifunc-2-local-i386-now.d: Likewise.
> >>         * ifunc-2-local-i386.d: Likewise.
> >>         * ifunc-20-i386.d: Likewise.
> >>         * ifunc-21-i386.d: Likewise.
> >>         * ifunc-22-i386.d: Likewise.
> >>         * ifunc-5a-i386.d: Likewise.
> >>         * ifunc-5a-local-i386.d: Likewise.
> >>         * ifunc-5b-i386.d: Likewise.
> >>         * ifunc-5b-local-i386.d: Likewise.
> >>         * ifunc-5r-local-i386.d: Likewise.
> >>         * ifunc-6a-i386.d: Likewise.
> >>         * ifunc-6b-i386.d: Likewise.
> >>         * ifunc-7a-i386.d: Likewise.
> >>         * ifunc-7b-i386.d: Likewise.
> >>         * ifunc-8-i386.d: Likewise.
> >>         * ifunc-9-i386.d: Likewise.
> >>         * pr17154-i386-now.d: Likewise.
> >>         * pr17154-i386.d: Likewise.
> >>
> >>         * ifunc-23a-x86.d: Remove notarget.
> >>         * ifunc-24a-x86.d: Likewise.
> >>         * ifunc-25a-x86.d: Likewise.
> >
> > The above is OK.
>
> thanks.
>
> >>         binutils:
> >>         * testsuite/lib/binutils-common.exp (supports_gnu_osabi): Don't
> >>         enable on *-*-solaris*.
> >>
> >
> > This makes senses to me.  Since you are Solaris owner, I think it is OK.
>
> Except that I'm not ;-)  Even so, there remains the matter of the gas

We should make you the Solaris owner.

> tests XPASSing now.  I've since verified that the attached patchlet
> works, making the affected tests UNSUPPORTED.  This change affects
> non-Solaris targets, too, of course.
>
> Is this ok, together with the binutils-common.exp change?

That is OK.

Thanks.

> Thanks.
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
>         gas:
>         * testsuite/gas/elf/section12a.d: Use notarget instead of xfail.
>         * testsuite/gas/elf/section12b.d: Likewise.
>         * testsuite/gas/elf/section16a.d: Likewise.
>         * testsuite/gas/elf/section16b.d: Likewise.
>


--
H.J.