From nobody Tue Apr 26 23:47:23 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 62DD11AB7872 for ; Tue, 26 Apr 2022 23:47:34 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Knz851Tzpz3L5h for ; Tue, 26 Apr 2022 23:47:32 +0000 (UTC) (envelope-from joerg@bec.de) Received: (Authenticated sender: joerg@bec.de) by mail.gandi.net (Postfix) with ESMTPSA id 5D256240002 for ; Tue, 26 Apr 2022 23:47:25 +0000 (UTC) Date: Wed, 27 Apr 2022 01:47:23 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Subject: Re: llvm & RTTI over shared libraries Message-ID: Mail-Followup-To: freebsd-hackers@freebsd.org References: <079B1A26-DA8B-4158-8FD4-28EE1374CF1F.ref@yahoo.com> <079B1A26-DA8B-4158-8FD4-28EE1374CF1F@yahoo.com> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <079B1A26-DA8B-4158-8FD4-28EE1374CF1F@yahoo.com> X-Rspamd-Queue-Id: 4Knz851Tzpz3L5h X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of joerg@bec.de has no SPF policy when checking 217.70.183.193) smtp.mailfrom=joerg@bec.de X-Spamd-Result: default: False [-0.24 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; FREEFALL_USER(0.00)[joerg]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[217.70.183.193:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[bec.de]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_SPAM_LONG(0.96)[0.959]; MLMMJ_DEST(0.00)[freebsd-hackers]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[217.70.183.193:from] X-ThisMailContainsUnwantedMimeParts: N Am Mon, Apr 25, 2022 at 03:39:48PM -0700 schrieb Mark Millard: > Basically I avoid inline definitions of: > > virtual ~type_base(); > virtual ~type_int(); > virtual ~type_string(); You only need to ensure that the class has one non-pure non-inline function. That's the key function and determines the translation unit (and by extension the DSO) where the virtual table and the typeinfo is placed. If there is no such function, both will be defined as weak mergable symbol and that will not result in a unique address when using RTLD_LOCAL. Joerg