[commit: ghc] master: rts linker: Introduce MachOTypes (8ed29b5)

Moritz Angermann moritz.angermann at gmail.com
Mon Mar 27 14:23:01 UTC 2017


Hi Gabor,

thanks! And sorry for causing trouble.  I’ll look into the MachO
case.

Cheers,
 Moritz
> On Mar 27, 2017, at 8:50 PM, Gabor Greif <ggreif at gmail.com> wrote:
> 
> Hi Moritz,
> 
> I have just committed a6675a93efe7cae2f206508047a39e73ce4e92a5
> 
> There are two more spots to clean up, which I have left to you,
> since I have no MachO machine to test on:
> 
> ```
> git grep "_.*FormatInfo" | grep -v LinkerInternals.h
> linker/MachOTypes.h:typedef struct _ObjectCodeFormatInfo {
> linker/MachOTypes.h:typedef struct _SectionFormatInfo {
> ```
> 
> I suggest that you apply the same transformation unless the LinkerInternals.h's
> definition does not apply for this case.
> 
> Cheers,
> 
>    Gabor
> 
> 
> On 3/27/17, Gabor Greif <ggreif at gmail.com> wrote:
>> This commit 8ed29b50376856018dfbbcbd6d728c69af0c9f29 introduced a
>> compilation failure with gcc4.4 (my gcc). The typedef-name
>> `SectionFormatInfo` is redefined.
>> 
>> Here is the reason:
>> http://stackoverflow.com/questions/6526322/why-redefinition-of-typedef-error-with-gcc-4-3-but-not-gcc-4-6
>> 
>> I have a fix in testing, will commit shortly.
>> 
>> Cheers,
>> 
>>    Gabor
>> 
>> On 3/27/17, git at git.haskell.org <git at git.haskell.org> wrote:
>>> Repository : ssh://git@git.haskell.org/ghc
>>> 
>>> On branch  : master
>>> Link       :
>>> http://ghc.haskell.org/trac/ghc/changeset/8ed29b50376856018dfbbcbd6d728c69af0c9f29/ghc
>>> 
>>>> ---------------------------------------------------------------
>>> 
>>> commit 8ed29b50376856018dfbbcbd6d728c69af0c9f29
>>> Author: Moritz Angermann <moritz.angermann at gmail.com>
>>> Date:   Tue Mar 21 10:59:49 2017 -0400
>>> 
>>>    rts linker: Introduce MachOTypes
>>> 
>>>    This diff introduces MachOTypes, to reduce the need to typing
>>> `struct`
>>>    all the time.  It also coaleces the 64 and non 64 structs. It also
>>> adds
>>>    additional fiedls to the object code structure for macho, which makes
>>>    working with macho object code much simpler and requires less passing
>>>    around of variabls or address recomputation for the header, symbol
>>>    table, etc...
>>> 
>>>    Furthermore this diff introduces a type for a linked list of stubs.
>>> 
>>>    I had to move the #ifdef from the bottom of the file up, to be able
>>> to
>>>    extend the object code structure conditional on the use of the macho
>>> file format.
>>> 
>>>    This is just one of the pieces for the rts linker
>>>    support for ios (aarch64-macho)
>>> 
>>>    ---
>>> 
>>>    The following diagram and legend tries to explain the dependencies a
>>>    bit:
>>>    ```
>>>      .- D3240
>>>      v
>>>    D3255 <- D3252 <- D3251 <- This
>>>      ^
>>>      '- D3238
>>>    ```
>>> 
>>>    - In D3238 we started allowing preloading object code with mmap
>>>      in iOS, where we can't have r+w+x.
>>>    - In D3239 we introduced a richer extension of the object code
>>>      data type to make working with mach-o files easier.
>>>    - In D3240 we set the stage to allow loading archives (.a) on iOS
>>>    - In D3251 we added init and deinit functions to populate and
>>>      depopulate the enriched object code data structure for mach-o
>>>      files.
>>>    - In D3252 we refactored most of the MachO.c file to use the
>>>      new types and data structure.
>>>    - in D3255 we finally introduce the aarch64-mach-o linker.
>>> 
>>>    Reviewers: austin, erikd, simonmar, rwbarton, bgamari
>>> 
>>>    Subscribers: rwbarton, thomie, ryantrinkle
>>> 
>>>    Differential Revision: https://phabricator.haskell.org/D3239
>>> 
>>> 
>>>> ---------------------------------------------------------------
>>> 
>>> 8ed29b50376856018dfbbcbd6d728c69af0c9f29
>>> rts/Linker.c            |   6 +++
>>> rts/LinkerInternals.h   |  28 +++++++++-
>>> rts/linker/MachOTypes.h | 133
>>> ++++++++++++++++++++++++++++++++++++++++++++++++
>>> 3 files changed, 165 insertions(+), 2 deletions(-)
>>> 
>>> Diff suppressed because of size. To see it, use:
>>> 
>>>    git diff-tree --root --patch-with-stat --no-color
>>> --find-copies-harder
>>> --ignore-space-at-eol --cc 8ed29b50376856018dfbbcbd6d728c69af0c9f29
>>> _______________________________________________
>>> ghc-commits mailing list
>>> ghc-commits at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-commits
>>> 
>> 



More information about the ghc-devs mailing list