delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/08/02/13:47:51

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 572Hlplc427820
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 572Hlplc427820
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=SBqMglA3
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CF453858C50
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1754156870;
bh=yQCEScr9Bk38pISc4O/u2XstVvn+bCW+/xKegY5kR6s=;
h=Date:To:cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=SBqMglA3eex160FDkdTV2gtzlT8aJoyztvO0l/wgRm8NWNt98m0+tblOsYbSAq5Y4
T7OUfmV8K7fPPx2SI11pLvutuOxqNL4Q8oMc2rXdeDbfabQreDExRfQZzZKTT2a/eU
MIAzZ1Hvh+fz/fuLK5uTl5uU5uSkUN5Xc1E/ZD/g=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C4CC3858D1E
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9C4CC3858D1E
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1754156845; cv=none;
b=SgLiRjWweEowc6JeFp5HO8cfOoIBhn4qq1hwukmuGd4f7wc47HOIWJkFreAFy1YLJefgJSrwQMsXmOaGBAmsMuj0Q3U2Bel4XFbhoYtFYHW52TlH3I7O6nArcXsfPRn9zd3dWIBc4azK8YrNQSigSz+6As3Tsy/zi0ss8+CrtUs=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1754156845; c=relaxed/simple;
bh=5w6W6xGSjxgxYQHdnXpdXas2qwKpITHaXwQIic6U+p8=;
h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;
b=wAv9rizz9qyztp7xc5sJEzJjs5XesSo91F5wUtqeliUSsmRjrY+kk+znCjFmMKIAmwFoNK3R0CB2yFjFBTjwxO0O9SEarQUYNdN1uIlwRSrsFz84acIlD4yVSjprPoktEUJCHF/aKgyxkj6vuRNmyQ/IFYjmNoD51/JXhtTz/u8=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C4CC3858D1E
Date: Sat, 2 Aug 2025 10:47:25 -0700 (PDT)
X-X-Sender: jeremyd AT resin DOT csoft DOT net
To: ASSI <Stromeko AT nexgo DOT de>
cc: cygwin AT cygwin DOT com
Subject: Re: new c++ new/delete overloads need wrapping?
In-Reply-To: <871ppuklcc.fsf@Gerda.invalid>
Message-ID: <0f4d29b7-8436-b673-6996-2e2f3320c1aa@jdrake.com>
References: <81535510-8360-1c72-442a-0b630a6d937f AT jdrake DOT com>
<871ppuklcc DOT fsf AT Gerda DOT invalid>
MIME-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Jeremy Drake via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Jeremy Drake <cygwin AT jdrake DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Sat, 2 Aug 2025, ASSI via Cygwin wrote:

> Jeremy Drake via Cygwin writes:
> > I was looking into C++ new/delete --wrap linker options, and noticed that
> > in a quick test the wrapper for delete was not being called.  This was
> > because delete is being compiled to _ZdlPvm and that symbol is not present
> > in the --wrap arguments in the GCC spec, and is not part of the
> > per_process_cxx_malloc struct.  I'm not seeing anything in that cxx_malloc
> > struct like a size or version number, so I don't know a good way to
> > extend it given that it is part of the startup code linked into every
> > binary.
>
> So, something like this?
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/gcc/config/i386/cygwin-w64.h b/gcc/config/i386/cygwin-w64.h
> index 8180d27c971..177e8203715 100644
> --- a/gcc/config/i386/cygwin-w64.h
> +++ b/gcc/config/i386/cygwin-w64.h
> @@ -28,13 +28,24 @@ along with GCC; see the file COPYING3.  If not see
>     malloc-like operators.  See N2800 #17.6.4.6 [replacement.functions] */
>  #undef CXX_WRAP_SPEC_LIST
>  #define CXX_WRAP_SPEC_LIST " \
> -  --wrap _Znwm \
> -  --wrap _Znam \
> -  --wrap _ZdlPv \
> -  --wrap _ZdaPv \
> +  --wrap _ZnwmSt11align_val_tRKSt9nothrow_t \
> +  --wrap _ZnwmSt11align_val_t \
>    --wrap _ZnwmRKSt9nothrow_t \
> +  --wrap _Znwm \
> +  --wrap _ZnamSt11align_val_tRKSt9nothrow_t \
> +  --wrap _ZnamSt11align_val_t \
>    --wrap _ZnamRKSt9nothrow_t \
> +  --wrap _Znam \
> +  --wrap _ZdlPvmSt11align_val_t \
> +  --wrap _ZdlPvm \
> +  --wrap _ZdlPvSt11align_val_tRKSt9nothrow_t \
> +  --wrap _ZdlPvSt11align_val_t \
>    --wrap _ZdlPvRKSt9nothrow_t \
> +  --wrap _ZdlPv \
> +  --wrap _ZdaPvmSt11align_val_t \
> +  --wrap _ZdaPvm \
> +  --wrap _ZdaPvSt11align_val_tRKSt9nothrow_t \
> +  --wrap _ZdaPvSt11align_val_t \
>    --wrap _ZdaPvRKSt9nothrow_t \
>  "
>
> --8<---------------cut here---------------end--------------->8---
>
> The symbols were in reverse order, so I kept it that way.

Pretty much, but I think you lost _ZdaPv in the reshuffle.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019