Skip to content
Snippets Groups Projects
  • Tamar Christina's avatar
    bd4fdc6a
    Implement split-sections support for windows. · bd4fdc6a
    Tamar Christina authored
    Summary:
    Initial implementation of split-section on Windows.
    
    This also corrects section namings and uses the platform
    convention of `$` instead of `.` to separate sections.
    
    Implementation is based on @awson's patches to binutils.
    
    Binutils requires some extra help when compiling the libraries
    for GHCi usage. We drop the `-T` and use implicit scripts to amend
    the linker scripts instead of replacing it.
    
    Because of these very large GHCi object files, we need big-obj support,
    which will be added by another patch.
    
    Test Plan: ./validate
    
    Reviewers: awson, austin, bgamari
    
    Subscribers: dfeuer, rwbarton, thomie, snowleopard, #ghc_windows_task_force
    
    GHC Trac Issues: #12913
    
    Differential Revision: https://phabricator.haskell.org/D3383
    bd4fdc6a
    History
    Implement split-sections support for windows.
    Tamar Christina authored
    Summary:
    Initial implementation of split-section on Windows.
    
    This also corrects section namings and uses the platform
    convention of `$` instead of `.` to separate sections.
    
    Implementation is based on @awson's patches to binutils.
    
    Binutils requires some extra help when compiling the libraries
    for GHCi usage. We drop the `-T` and use implicit scripts to amend
    the linker scripts instead of replacing it.
    
    Because of these very large GHCi object files, we need big-obj support,
    which will be added by another patch.
    
    Test Plan: ./validate
    
    Reviewers: awson, austin, bgamari
    
    Subscribers: dfeuer, rwbarton, thomie, snowleopard, #ghc_windows_task_force
    
    GHC Trac Issues: #12913
    
    Differential Revision: https://phabricator.haskell.org/D3383
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
merge_sections_pe.ld 597 B
/* Linker script to undo -split-sections and merge all sections together when
 * linking relocatable object files for GHCi.
 * ld -r normally retains the individual sections, which is what you would want
 * if the intention is to eventually link into a binary with --gc-sections, but
 * it doesn't have a flag for directly doing what we want. */
SECTIONS
{
    .text : {
        *(.text$*)
    }
    .rdata : {
        *(.rdata$*)
    }
    .data : {
        *(.data$*)
    }
    .pdata : {
        *(.pdata$*)
    }
    .xdata : {
        *(.xdata$*)
    }
    .bss : {
        *(.bss$*)
    }
}