From kde-core-devel Tue Dec 04 12:40:20 2001 From: Bernhard Rosenkraenzer Date: Tue, 04 Dec 2001 12:40:20 +0000 To: kde-core-devel Subject: KDE hackers, please read (was [nathan@codesourcery.com: Re: GCC X-MARC-Message: https://marc.info/?l=kde-core-devel&m=100746955931520 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--qDbXVdCdHGoSgWSk" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --qDbXVdCdHGoSgWSk Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: FYI ---------- Forwarded message ---------- Date: Mon, 3 Dec 2001 17:17:55 +0100 From: Jakub Jelinek To: Subject: KDE hackers, please read (was [nathan@codesourcery.com: Re: GCC 3.0.3: Bugs to Fix]) Hi! If you want dynamic cast (and that's just one thing) to work with dlopen in gcc3+, you need to use RTLD_GLOBAL. (Don't get confused by Nathan not understanding what if and only if means). Jakub --qDbXVdCdHGoSgWSk Content-Type: MESSAGE/RFC822; CHARSET=US-ASCII Content-ID: Content-Description: Precedence: bulk Message-ID: <3C0B4C55.D64E226A@codesourcery.com> Date: Mon, 03 Dec 2001 09:56:37 +0000 From: Nathan Sidwell X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: Franz Sirl , hubbard@ilm.com, jyost@ilm.com, kainz@ilm.com, bramsh@acm.org CC: Mark Mitchell , gcc@gcc.gnu.org Subject: Re: GCC 3.0.3: Bugs to Fix References: <14740000.1007070798@gandalf.codesourcery.com> <200111302322.03466@enzo.bigblue.local> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Franz Sirl wrote: > > On Thursday 29 November 2001 22:53, Mark Mitchell wrote: > > Here are some bugs that it would be nice, although not imperative, > > to fix before 3.0.3: > > What about PR3993? Another KDE2 blocking bug... Is there a reason that dlopen ("foo", RTLD_NOW | RTLD_GLOBAL) is unacceptable? The ABI was designed on the assumption that it is possible at link or load time to collapse objects with the same name to a single address, and thus use address comparisons to determine equality. Loading without RTLD_GLOBAL break that. Presumably you'll also observe that it's possible for the 'same function' has two different addresses, one in the library and one not in the library. [5.10] says 'Two pointers ... compare equal if and only if ... both point to the same object or function ...' Ooh, that's not actually the same as 'Two pointers compare unequal if and only if they point to different objects or functions' (but I always thought that was true, defect anyone?) Anyhow, from the ABI spec point of view, you've fallen outside the ABI by disjointing the namespace. To make it work without RTLD_GLOBAL would pessimize type comparisons because we'd have to compare strings rather than pointers to strings. What's worse is that it's the 'unequal to' comparison that could not be optimized, and IMO, dynamic cast & catch have more not-equal cases than equal cases. If we HAD to make this work at ANY cost, then I'd change the ABI to secrete a hash of the typename that could be compared in O(0), rather than O(length). But see - that's an ABI change. nathan -- Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC 'But that's a lie.' - 'Yes it is. What's your point?' nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org --qDbXVdCdHGoSgWSk--