NetBSD Problem Report #59390

From www@netbsd.org  Sat May  3 13:26:43 2025
Return-Path: <www@netbsd.org>
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) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 571B01A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  3 May 2025 13:26:43 +0000 (UTC)
Message-Id: <20250503132641.B1A3E1A923E@mollari.NetBSD.org>
Date: Sat,  3 May 2025 13:26:41 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: build with -Wl,-z,pack-relative-relocs by default
X-Send-Pr-Version: www-1.0

>Number:         59390
>Category:       toolchain
>Synopsis:       build with -Wl,-z,pack-relative-relocs by default
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 03 13:30:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
Relocation Relativists LLC
>Environment:
>Description:
Now that ld.elf_so supports packed relative relocations (PR bin/59360: ld.elf_so(8): missing RELR support, https://gnats.NetBSD.org/59360), we should enable it in the build on any platforms where GNU binutils supports it, particularly when MKPIE=yes.  Should be some hefty savings available for some programs:

(amd64)
$ size apropos.{before,after}
   text    data     bss     dec     hex filename
 221781   44930      72  266783   4121f apropos.before
  91637   44978      72  136687   215ef apropos.after
$ size makemandb.{before,after}
   text    data     bss     dec     hex filename
 409881   75868     264  486013   76a7d makemandb.before
 250073   75916     264  326253   4fa6d makemandb.after

Unfortunately, this is blocked on CTF tool support for RELR (PR toolchain/59364: ctf tools needs update, https://gnats.NetBSD.org/59364):

ERROR: nbctfmerge: apropos: Cannot get sect .relr.dyn data: Invalid section descriptor
>How-To-Repeat:
binary inspetion
>Fix:
Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.