summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/utils/merge_sections.ld26
1 files changed, 26 insertions, 0 deletions
diff --git a/driver/utils/merge_sections.ld b/driver/utils/merge_sections.ld
new file mode 100644
index 0000000000..8c82ca09b5
--- /dev/null
+++ b/driver/utils/merge_sections.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*)
+ }
+ .rodata.cst16 : {
+ *(.rodata.cst16*)
+ }
+ .rodata : {
+ *(.rodata*)
+ }
+ .data.rel.ro : {
+ *(.data.rel.ro*)
+ }
+ .data : {
+ *(.data*)
+ }
+ .bss : {
+ *(.bss*)
+ }
+}