NetBSD Problem Report #59917

From martin@gethsemane.aprisoft.de  Wed Jan 14 14:15:37 2026
Return-Path: <martin@gethsemane.aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "R13" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 06E0D1A9242
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 14 Jan 2026 14:15:36 +0000 (UTC)
Message-Id: <20260114141532.65171E1FFBB@mail.duskware.de>
Date: Wed, 14 Jan 2026 15:15:27 +0100 (CET)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: ld.elf_so broken on macppc
X-Send-Pr-Version: 3.95
X-From4GNATS: "martin@NetBSD.org via gnats" <gnats-admin@NetBSD.org>

>Number:         59917
>Category:       port-powerpc
>Synopsis:       ld.elf_so broken on macppc
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    jmcneill
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 14 14:20:01 +0000 2026
>Closed-Date:    Thu Jan 15 22:14:57 +0000 2026
>Last-Modified:  Thu Jan 15 22:15:02 +0000 2026
>Originator:     Martin Husemann
>Release:        NetBSD 11.99.4
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD gethsemane.aprisoft.de 11.99.4 NetBSD 11.99.4 (GETHSEMANE) #440: Mon Jan 5 10:42:15 CET 2026 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/macppc/compile/GETHSEMANE macppc
Architecture: powerpc
Machine: macppc
>Description:

I just tried to update userland to latest -current as of a few hours ago
(clean build), and stopped set extraction shortly after base.tgz was done
(due to first failures).
Now everything fails to find libraries:

[/] gethsemane # ls
/bin/ls: Shared object "libutil.so.7" not found
[/] gethsemane # /rescue/ldd /bin/ls
/bin/ls:
        -lutil.7 => /lib/libutil.so.7
        -lgcc_s.1 => /lib/libgcc_s.so.1
        -lc.12 => /lib/libc.so.12
[/] gethsemane # ldd /bin/ls
/usr/bin/ldd: Shared object "libgcc_s.so.1" not found
[/] gethsemane # /rescue/ls -l /lib/libutil.so.7
lrwxr-xr-x  1 root  wheel  15 Jan 14 13:09 /lib/libutil.so.7 -> libutil.so.7.25
[/] gethsemane # /rescue/ls -l /lib/libutil.so.7.25
-r--r--r--  1 root  wheel  155088 Jan 14 13:08 /lib/libutil.so.7.25
[/] gethsemane # /rescue/ls -l /libexec/ld.elf_so
-r-xr-xr-x  1 root  wheel  105404 Jan 14 13:39 /libexec/ld.elf_so


Downgrading ld.elf_so to the state of Jan 2 (arbitray quick pick for a
save version) fixes it.


>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-powerpc/59917: ld.elf_so broken on macppc
Date: Wed, 14 Jan 2026 17:47:20 +0100

 It is caused by the espresso fixup code, this patch works around the issue:

 Index: fixup.c
 ===================================================================
 RCS file: /cvsroot/src/libexec/ld.elf_so/arch/powerpc/fixup.c,v
 retrieving revision 1.1
 diff -u -p -r1.1 fixup.c
 --- fixup.c	9 Jan 2026 22:54:27 -0000	1.1
 +++ fixup.c	14 Jan 2026 16:34:36 -0000
 @@ -39,9 +39,11 @@ __RCSID("$NetBSD: fixup.c,v 1.1 2026/01/
  #include "debug.h"
  #include "rtld.h"

 +#if 0
  static bool _rtld_fixup_init;
  static uint32_t _rtld_ppc_pvr;
  static int _rtld_ncpus;
 +#endif

  union instr {
  	u_int	i_int;
 @@ -75,6 +77,7 @@ int
  _rtld_map_segment_fixup(Elf_Phdr *phdr, caddr_t data_addr, size_t data_size,
      int data_prot)
  {
 +#if 0
  	uint32_t *start, *where, *end;
  	union instr previ;

 @@ -145,6 +148,7 @@ next_opcode:
  		    xstrerror(errno));
  		return -1;
  	}
 +#endif

  	return 0;
  }


 This machine is MP and does not have an espresso CPU.

 Jared, did you mean

 	if (!IBMESPRESSO_P(_rtld_ppc_pvr) || _rtld_ncpus == 1) {
 		return 0;
 	}

 ?

 Martin

Responsible-Changed-From-To: port-powerpc-maintainer->jmcneill
Responsible-Changed-By: jmcneill@NetBSD.org
Responsible-Changed-When: Thu, 15 Jan 2026 21:02:59 +0000
Responsible-Changed-Why:
take


State-Changed-From-To: open->closed
State-Changed-By: jmcneill@NetBSD.org
State-Changed-When: Thu, 15 Jan 2026 22:14:57 +0000
State-Changed-Why:
fixed


From: "Jared D. McNeill" <jmcneill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59917 CVS commit: src/libexec/ld.elf_so/arch/powerpc
Date: Thu, 15 Jan 2026 22:13:32 +0000

 Module Name:	src
 Committed By:	jmcneill
 Date:		Thu Jan 15 22:13:32 UTC 2026

 Modified Files:
 	src/libexec/ld.elf_so/arch/powerpc: fixup.c

 Log Message:
 Fix ld.elf_so on non-espresso SMP and ibm4xx

 The espresso test in ld.elf_so for espresso had two flaws:

  1) It relied on emulation of the privileged mfpvr instruction for
     userspace, which doesn't exist on ibm4xx platforms.
  2) An && should have been an ||, which incorrectly caused the
     workaround to be applied to all SMP systems.

 Fixes PR# port-powerpc/59917


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/libexec/ld.elf_so/arch/powerpc/fixup.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.