From mboxrd@z Thu Jan 1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org
X-Spam-Level:
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4
Received: (qmail 8444 invoked from network); 6 Jun 2023 09:06:14 -0000
Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368)
by inbox.vuxu.org with ESMTPUTF8; 6 Jun 2023 09:06:14 -0000
ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1686042374;
b=muxR0aNlp9zvp+gADc3fyBBSSlkCOT8/sdCTBDox3P7vpvdnl0Nl0F+bTQAlX0vRaItcJTOjsU
YDpZUzSUWrFcBqXrCiWCFVjcupVGVKhmqR6+YpFWMUU1oiWW4T80xu8idO8LMbTg/Q1JAEJXg0
iWFXgai/PuFG3UZWqK301NzG0MeZAb/QZB2nFz54g1eSN3VaA0OlBbPns0/1NRD1RxfCpaBmSS
sDNouGlMjB9qcmctqUioH30196hrGOJyVAN8qys8WyEpD1UO/aweGhzTjlJnDkthCEG0qx0pun
+eY1rrib3Igebvpb5/fEpE73z8e9mzA58ynqoplkxMwHvQ==;
ARC-Authentication-Results: i=1; zsh.org;
iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96;
dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256;
dmarc=pass header.from=ntlworld.com;
arc=none
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1686042374;
bh=Lw4AgqkUKgjZtaKgbR6ghsR6rpSlD9gMLK8tnRZMRGA=;
h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help:
List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:
References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature:
DKIM-Signature;
b=pHegSn6BqMR1fuYDcxGOD7qyNP+hM7wlENlvFo4c6+w3GuR7hzRk2dvb7DFwFTzxj2dUHwc3u3
vrnrtiezHb+RfCEAnBJRjMYvvCRFCnwKsHeb74/e5RnXZ0HxeBU4rEKXAxQKbyHNjpMN4xwP9E
RBNMFtYtrNx65iQ7XoMkZbKpescuXR0mcE7uVhFrKlcUdVpu/FvJBJ9j0TJDsk9U1jZSAYKgWP
vwCeWif+3itc+zZ8SUxR3qli6cdZrlx3xcat2PmQL0px3gxPwGR5uLhOwODB89Rjw0KDqIoYuc
6pGRo6N5vDYxCwa3PkwlusTaiHFp4cXKWWw8WZqChlByfQ==;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org;
s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:
List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding:
Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From:
Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID;
bh=//dr+a2dsP61dy+EGY2k1zfCX97L276A2Pct2G5UZYg=; b=WR5hqPxIvjveSPbE1de9p2iuMv
FqCoz+BopAR4eO1RFe1lopYQKXjYjQzueHz0nTS4/OZ1G2pzu/n71+39HdZd3I258H5gvpZMpZJCI
hJwtYLfhu+BEQChXkOBZR6dffpYNlxG66EhU2tnspoF4vOckSwg6ZBsB0j3DGgqyVfk7NB9HLc6pi
pIssnWkdu82pTYzb7Dnft83Cj3LGumfUSpVDrqaT5dhgK/6d7+1L7EYWPrFvWZqP5Na5QBcRRGjjJ
8XCOwhEfj75EQPIl/1yDveI3nBzDpjKb7n7lk0qOUMw/iVFq4CD2PX6atg+o89QW3MKHajZcGrUZN
mIVaZCRQ==;
Received: by zero.zsh.org with local
id 1q6Sdp-0008Ie-Bj;
Tue, 06 Jun 2023 09:06:13 +0000
Authentication-Results: zsh.org;
iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96;
dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256;
dmarc=pass header.from=ntlworld.com;
arc=none
Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:34106)
by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
id 1q6SdB-0007yY-9n;
Tue, 06 Jun 2023 09:05:35 +0000
Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net)
by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1)
(envelope-from
)
id 1q6SdA-0001Lp-Mn
for zsh-workers@zsh.org; Tue, 06 Jun 2023 11:05:32 +0200
Received: from oxbe8.tb.ukmail.iss.as9143.net ([172.25.160.139])
by smtp1.tb.ukmail.iss.as9143.net with ESMTP
id 6SdAqW0fShvLN6SdAquH3B; Tue, 06 Jun 2023 11:05:32 +0200
X-Env-Mailfrom: p.w.stephenson@ntlworld.com
X-Env-Rcptto: zsh-workers@zsh.org
X-SourceIP: 172.25.160.139
X-CNFS-Analysis: v=2.4 cv=SZoxNNdu c=1 sm=1 tr=0 ts=647ef6dc cx=a_exe
a=pgSR3NrKiwmx/6vnWRL19w==:117 a=1DWFKdCB1IcA:10 a=IkcTkHD0fZMA:10
a=6E303GnDO8onAdg1nqsA:9 a=QEXdDO2ut3YA:10 a=75Kt_H3ikK-EkTT1woid:22
X-Authenticated-Sender: p.w.stephenson@ntlworld.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com;
s=meg.feb2017; t=1686042332;
bh=Lw4AgqkUKgjZtaKgbR6ghsR6rpSlD9gMLK8tnRZMRGA=;
h=Date:From:To:In-Reply-To:References:Subject;
b=Y5U3UMUNBTcRLBA5E0zou5YXK/V3HY4yLGupOOqseugGk3ZCjjmKy5oaPwyg6943N
pqdn17esmS04Garzfe54ukiX7uSecPJEG9IAR2vBIJVz+l25PPoveyNL4lYIG1VNfq
EoPM0L3XhiBCZJUoTop+z4iNCprLTU9mFoqjSbTfG3PcIcZZ6D2z7vy8ZkRiyw+6b5
TLrNgBH0LfdCYliTdfY9FM0awesSZyPlrGc1hzpQwpjirc7gzLYvwrOrJY40RgDp1V
z/Ksu/NYoa2CJO4V3W2F+5wjq6uvyryblfonRVL2fYT2dzQ3C0oKadtgFMT6u/pbiw
8GdBGi0RsQe7g==
Date: Tue, 6 Jun 2023 10:05:32 +0100 (BST)
From: Peter Stephenson
To: zsh-workers@zsh.org
Message-ID: <1604572963.1688389.1686042332603@mail.virginmedia.com>
In-Reply-To:
References:
<027f2a491b638e2ffaf7766fe4adf29537c11fdf.camel@fifi.org>
<227fe72b-7441-935c-55a7-421945da54b3@hostalia.de>
Subject: Re: [Bug] modules zsh/tcp, zsh/zftp unloadable, probably affecting
most modern Linuxes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Priority: 3
Importance: Normal
X-Mailer: Open-Xchange Mailer
X-Originating-IP: 147.161.224.167
X-Originating-Client: open-xchange-appsuite
X-CMAE-Envelope: MS4xfCXA0tC4BxmXv+29qyuHv+ye3HMsQwiwkHSuk4i9RiUGi2u2DyTz4k8Sb1hAUctDTIBkZPn/LdmksPpWywkhqcAkCfMD4FXztcRB/tmEimGT2eS7UzZG
OsqiSZuu5ygMnC5/hMq0mdL8UpHncpCZ5tyRV0vk4h5lqIORIpASJCvhehSkRWlfwln7zwyOe2x5cq0UesKAdJU3xyED5nrbVplpth+vkxuQlUxl3EfYJYjo
X-Seq: 51835
Archived-At:
X-Loop: zsh-workers@zsh.org
Errors-To: zsh-workers-owner@zsh.org
Precedence: list
Precedence: bulk
Sender: zsh-workers-request@zsh.org
X-no-archive: yes
List-Id:
List-Help: ,
List-Subscribe: ,
List-Unsubscribe: ,
List-Post:
List-Owner:
List-Archive:
> On 06/06/2023 07:42 Jun T wrote:
> I think the problem is '-Wl,-z,now'. man ld(1) says:
>
> now When generating an executable or shared library, mark it to
> tell the dynamic linker to resolve all symbols when the program
> is started, or when the shared library is loaded by dlopen,
> instead of deferring function call resolution to the point when
> the function is first called.
>
> It seems this option has the higher precedence than the option
> '-z lazy' in the same command line, or the RTLD_LAZY for dlopen().
>
> On Fedora-38:
> % readelf --dynamic /usr/lib64/zsh/5.9/zsh/zftp.so | grep FLAG
> 0x000000000000001e (FLAGS) BIND_NOW
> 0x000000006ffffffb (FLAGS_1) Flags: NOW
>
> I think this flag in zftp.so is the result of '-z now'
>
> On Debian-11, /usr/lib/x86_64-linux-gnu/zsh/5.8/zsh/zftp.so has the
> same flag. I guess Debian binary package is also built with '-z now'.
>
> The zftp.so built by myself does not have this flag.
>
> Why '-z now' is used when building binary packages? For security?
I think this is just so that failure to find symbols at all will
show up quickly in the build rather than at run time, which would
be a real pain.
One solution might be to build first with -z now to confirm that it
does link, and then -z lazy to make it more useful when installed.
pws