[RFA 2/5] Darwin: Handle unrelocated dyld.

Joel Brobecker brobecker@adacore.com
Wed Sep 19 13:41:00 GMT 2018


> 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



More information about the Gdb-patches mailing list