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

--- Comment #3 from Rainer Orth <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
Hi Nick,

>   Please could you try out this patch and let me know if it works ?
>
>   It is a bit of a guess on my part, but I think that it has potential.

it didn't initially.  When checking a debug build of ld, I found that
the hdr->sh_type == bed->obj_attrs_section_type condition still held.
The attached revised patch fixes that.

However, logically the condition is the wrong way around IMO: instead of
checking !is_solaris, it should be something like is_gnu, i.e. check if
the target supports the GNU OSABI.  Otherwise, whenever any OS adds a
conflicting SHT_<OS>_* entry in the SHT_LOOS/SHT_HIOS range, things will
be broken again.

Besides, ELF_TARGET_OS was only defined on Solaris/x86 so far.  The
revised patch adds matching definitions for Solaris/SPARC.

With those changes, gcc trunk bootstraps with gas/gld 2.44.90 worked
fine.

However, there are quite a number of regressions in the binutils
testsuite:

--- ../binutils-2.45-branch.prev/mail-report.log        2025-07-14
13:49:32.035322741 +0200
+++ mail-report.log     2025-07-15 10:15:39.413628458 +0200
@@ -24,34 +24,75 @@


 Running target unix
-FAIL: bootstrap
-FAIL: bootstrap with strip
-FAIL: bootstrap with -Wl,--traditional-format
-FAIL: bootstrap with -Wl,--no-keep-memory
-FAIL: bootstrap with -Wl,--relax
-FAIL: bootstrap with -Wl,--max-cache-size=-1
-FAIL: bootstrap with -Wl,-z,nosectionheader
-FAIL: cdtest
-FAIL: cdtest with -Ur
+FAIL: Arrays (conflicted)
+FAIL: Conflicting cycle 1.B-1
+FAIL: Conflicting cycle 1.B-2
+FAIL: Conflicting cycle 1.parent
+FAIL: Conflicting cycle 2.A-1
+FAIL: Conflicting cycle 2.A-2
+FAIL: Conflicting cycle 2.parent
+FAIL: Conflicting cycle 3.C-1
+FAIL: Conflicting cycle 3.C-2
+FAIL: Conflicting cycle 3
+FAIL: Conflicting Enums
+FAIL: Conflicting Typedefs
+FAIL: cross-TU-cyclic-conflicting
+FAIL: cross-TU-into-cycle
+FAIL: Conflicted data syms, partially indexed, stripped, with variables
+FAIL: Conflicted data syms, partially indexed, stripped
+FAIL: Diagnostics - Invalid CU name offset
+FAIL: Diagnostics - Non-zero parlabel in parent
+FAIL: Semioverlapping enumerators
+FAIL: Overlapping enumerators
+FAIL: Run with libpr19553c.so
+FAIL: Build pr25617-1 (-z nosectionheader, none)
+FAIL: Build pr25617-1 (PIE, -z nosectionheader, none)
+FAIL: Run pr25617-1 (PIE, -z nosectionheader, none)
+FAIL: Build pr25617-1 (-z nosectionheader, objcopy)
+FAIL: Build pr25617-1 (PIE, -z nosectionheader, objcopy)
+FAIL: Run pr25617-1 (PIE, -z nosectionheader, objcopy)
+UNRESOLVED: Update pr25617-1a-now-no-sec-hdr.so (objcopy)
+FAIL: Build pr25617-1 (-z nosectionheader, strip)
+FAIL: Build pr25617-1 (PIE, -z nosectionheader, strip)
+FAIL: Run pr25617-1 (PIE, -z nosectionheader, strip)
+UNRESOLVED: Update pr25617-1a-now-no-sec-hdr.so (strip)
+FAIL: Build pr26590 (1)
+FAIL: Run with pr14862-1.c libpr14862.so
+FAIL: pr26580-3
+FAIL: Build libpr23161c.so
+FAIL: Build pr23161c
+FAIL: Build libno-plt-1b.so
+FAIL: No PLT (dynamic 1a)
+FAIL: No PLT (dynamic 1b)
+FAIL: No PLT (dynamic 1c)
+FAIL: No PLT (PIE 1e)
+FAIL: No PLT (PIE 1f)
+FAIL: No PLT (PIE 1g)
+FAIL: PR ld/28138 (build only)

                === ld Summary ===

-# of expected passes           548
-# of unexpected failures       9
-# of expected failures         6
-# of untested testcases                21
-# of unsupported tests         198
+# of expected passes           1268
+# of unexpected failures       43
+# of expected failures         7
+# of unresolved testcases      2
+# of untested testcases                19
+# of unsupported tests         176
                === libctf tests ===


 Running target unix
+FAIL: libctf-lookup/ambiguous-struct
+FAIL: libctf-lookup/enumerator-iteration
+FAIL: libctf-repeat-cu.exp
+FAIL: libctf-regression/pptrtab
 FAIL: libctf-writable/ctf-compressed

                === libctf Summary ===

-# of expected passes           17
-# of unexpected failures       1
-# of unsupported tests         3
+# of expected passes           33
+# of unexpected failures       5
+# of untested testcases                1

 Compiler version: gcc 
 Platform: i386-pc-solaris2.11

I've not yet found what's wrong here, however it seems to be CTF related
in some way:

exited abnormally with 1,
output:/var/gcc/binutils/i386/obj/binutils-2.45-branch/ld/../binutils/objdump:
error: ctf_arc_bufopen(): cannot open CTF
/var/gcc/binutils/i386/obj/binutils-2.45-branch/ld/../binutils/objdump: CTF
open failure: Buffer does not contain CTF data.
/var/gcc/binutils/i386/obj/binutils-2.45-branch/ld/../binutils/objdump:
tmpdir/dump: file format not recognized

FAIL: Conflicting cycle 1.B-1

> PS.  I think that part of the original problem was that most of the
> SHT_SUNW_xxx definitions were missing from elf/common.h so Matthieu did not
> know that the chosen value for SHT_GNU_ATTRIBUTES overlapped with
> SHT_SUNW_caps.  (This is just a guess).  Anyway, in order to help avoid
> problems like this in the future the patch also updates common.h with as many
> of the SHT_SUNW_xxx section types as I could find.

Good: that would certainly help (at least if one looks for such
conflicts in the first place ;-)

There's more, however:

* <sys/link.h> has quite a number of DT_SUNW_* and DF_SUNW_* defines.

* <sys/elf.h> has ET_SUNW_*, PT_SUNW_*, SHF_SUNW_*.

One may want to add (some of?) those, too, maybe into a separate
include/elf/sun.h (or solaris.h).

Btw., rather than extracting them from the Solaris Linker and Libraries
guide, it's probably easier to go for the headers directly.  I can
provide a patch if that's deemed helpful.

And just FYI, there have been Solaris 11.4 SPARC and x86 systems in the
cfarm for some time now, so just in case you can look at the real thing ;-)

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

Reply via email to