From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67569 invoked by alias); 19 Sep 2018 13:41:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 67554 invoked by uid 89); 19 Sep 2018 13:41:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1724, day X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Sep 2018 13:41:01 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9E57456006; Wed, 19 Sep 2018 09:40:59 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Jmqyn0lRcoIj; Wed, 19 Sep 2018 09:40:59 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6C5A356004; Wed, 19 Sep 2018 09:40:59 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B4B3785884; Wed, 19 Sep 2018 06:40:57 -0700 (PDT) Date: Wed, 19 Sep 2018 13:41:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Simon Marchi , Xavier Roirand , gdb-patches@sourceware.org Subject: Re: [RFA 2/5] Darwin: Handle unrelocated dyld. Message-ID: <20180919134057.GN19172@adacore.com> References: <1534932677-9496-1-git-send-email-roirand@adacore.com> <1534932677-9496-3-git-send-email-roirand@adacore.com> <18e995c1bee8c82df212dd431136d259@polymtl.ca> <87lg7ysdpb.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lg7ysdpb.fsf@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-09/txt/msg00683.txt.bz2 > In my case the address of the solib event breakpoint is at the same > location in both cases. But, there is also this comment: > > + (Apparently dyld doesn't need to relocate itself on x86-64 darwin, > + but don't assume that). > > What this says to me is that perhaps there is an architecture where > darwin_handle_solib_event computes a different solib breakpoint address. > > My conclusion is that the patch is generally ok (certainly it works) > and, while this one part is unusual, it isn't fatally so. I am wondering whether the difference in what you are seeing might be explained by a difference in MacOS X version; if I were to guess, I would say that Xavier was running on Mac OS X Sierra. What version were you running on? Or perhaps the intent is to be extra careful meaning that while today the relocation is not necessary, we still handle it so that it continues working the day it becomes so? If the comment above is confusing, I would vote for removing it. To me, this is like Windows, where DLLs have prefered base addresses where they get loaded, but we still need to do the reloc just in case, because the loader may have to load it elsewhere. So what this is doing here is somewhat "classic". That makes me realize (again) that, for MacOS X, we should be more proactive at specificying which version a patch we are submitting was tested on, and some information about which versions of MacOS X a given patch helps. A fair amount of work that Tristan did once the initial port was created was to adapt it to subsequent versions of Darwin. Nearly every new version of Darwin introduced its new set of changes requiring additional adaptations. -- Joel