diff options
author | Tamar Christina <tamar@zhox.com> | 2017-03-26 19:05:46 +0100 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2017-07-08 00:02:36 +0100 |
commit | bd4fdc6aa34a85268f3e9a2bd3f4142a97724ce4 (patch) | |
tree | 984a144a47f4045b226a1511442bb13fd3a8a3cb /driver/utils/merge_sections_pe.ld | |
parent | 99adcc8804e91161b35ff1d0e5f718d18fcaa66a (diff) | |
download | haskell-bd4fdc6aa34a85268f3e9a2bd3f4142a97724ce4.tar.gz |
Implement split-sections support for windows.
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
Diffstat (limited to 'driver/utils/merge_sections_pe.ld')
-rw-r--r-- | driver/utils/merge_sections_pe.ld | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/driver/utils/merge_sections_pe.ld b/driver/utils/merge_sections_pe.ld new file mode 100644 index 0000000000..c9eed87ced --- /dev/null +++ b/driver/utils/merge_sections_pe.ld @@ -0,0 +1,26 @@ +/* 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$*) + } +} |