https://sourceware.org/bugzilla/show_bug.cgi?id=33162

            Bug ID: 33162
           Summary: Diagnostics FAILs on Solaris
           Product: binutils
           Version: 2.45
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libctf
          Assignee: unassigned at sourceware dot org
          Reporter: ro at gcc dot gnu.org
                CC: nick.alcock at oracle dot com
  Target Milestone: ---
            Target: *-*-solaris2.11

Once PR libctf/29292 is fixed, there are only two ld-ctf failures remaining on
Solaris:

FAIL: Diagnostics - Invalid CU name offset
FAIL: Diagnostics - Non-zero parlabel in parent

In both cases, the failure is similar: comparing the dump.out files in the
first
case gives

--- /homes/ro/dump.out  2025-07-16 14:03:36.750211689 +0200
+++ tmpdir/dump.out     2025-07-16 14:02:19.973710436 +0200
@@ -1,5 +1,5 @@

-tmpdir/dump:     file format elf32-i386
+tmpdir/dump:     file format elf32-i386-sol2

 Contents of CTF section .ctf:

@@ -9,8 +9,9 @@
     Flags: 0xe (CTF_F_NEWFUNCINFO, CTF_F_IDXSORTED, CTF_F_DYNSTR)
     Compilation unit name: (?)
     Data object section:       0x0 -- 0x3 (0x4 bytes)
-    Type section:      0x4 -- 0x33 (0x30 bytes)
-    String section:    0x34 -- 0x3f (0xc bytes)
+    Object index section:      0x4 -- 0x7 (0x4 bytes)
+    Type section:      0x8 -- 0x37 (0x30 bytes)
+    String section:    0x38 -- 0x43 (0xc bytes)

i.e. an additional Object index section not accounted for.

Further investigation can trace this to differences in the symbol tables
between Solaris and Linux: readelf -sW gives

* Solaris/i386:

Symbol table '.symtab' contains 8 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS A.c
     2: 00000000     0 FILE    LOCAL  DEFAULT  ABS 
     3: 000011d0     0 OBJECT  LOCAL  DEFAULT    8 _END_
     4: 00000170     0 OBJECT  LOCAL  DEFAULT    4 _START_
     5: 00001170     0 OBJECT  GLOBAL DEFAULT    6 _DYNAMIC
     6: 00000170     0 OBJECT  GLOBAL DEFAULT    4 _PROCEDURE_LINKAGE_TABLE_
     7: 000011c8     8 OBJECT  GLOBAL DEFAULT    8 a

* Linux/i686:

Symbol table '.symtab' contains 5 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS A.c
     2: 00000000     0 FILE    LOCAL  DEFAULT  ABS 
     3: 00002028     0 OBJECT  LOCAL  DEFAULT    7 _DYNAMIC
     4: 00002088     8 OBJECT  GLOBAL DEFAULT    8 a

I turns out that declaring _PROCEDURE_LINKAGE_TABLE_ as skippable fixes the
failures:

diff --git a/libctf/ctf-serialize.c b/libctf/ctf-serialize.c
--- a/libctf/ctf-serialize.c
+++ b/libctf/ctf-serialize.c
@@ -74,6 +74,7 @@ ctf_symtab_skippable (ctf_link_sym_t *sy
          || sym->st_shndx == SHN_UNDEF
          || strcmp (sym->st_name, "_START_") == 0
          || strcmp (sym->st_name, "_END_") == 0
+         || strcmp (sym->st_name, "_PROCEDURE_LINKAGE_TABLE_") == 0
          || (sym->st_type == STT_OBJECT && sym->st_shndx == SHN_EXTABS
              && sym->st_value == 0));
 }

On Solaris/SPARC there are a few more: I'll investigate separately.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to