aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorGeoffrey Noer <noer@cygnus>1998-03-19 23:04:54 +0000
committerGeoffrey Noer <noer@cygnus>1998-03-19 23:04:54 +0000
commit155d9cc48aa72784409f93ba5362024fe365882b (patch)
tree9ff341dfb84cbb01e5e2f143d1d6c560170b0ae7 /ld/scripttempl
parent059a638882562daa32f0e26ca7ba1fb8033c7ae6 (diff)
downloadgdb-155d9cc48aa72784409f93ba5362024fe365882b.zip
gdb-155d9cc48aa72784409f93ba5362024fe365882b.tar.gz
gdb-155d9cc48aa72784409f93ba5362024fe365882b.tar.bz2
Thu Mar 19 14:54:45 1998 Geoffrey Noer <noer@cygnus.com>
* scripttempl/pe.sc: The Cygwin32 library uses a .data$nocopy section to avoid copying certain data on fork. The linker used to include this between __data_start__ and __data_end__, but that breaks building the cygwin32 dll. The fix is to rename the section ".data_cygwin_nocopy" and explictly include it after __data_end__.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/pe.sc69
1 files changed, 35 insertions, 34 deletions
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
index 6a41aae..c516abd 100644
--- a/ld/scripttempl/pe.sc
+++ b/ld/scripttempl/pe.sc
@@ -1,7 +1,13 @@
# Linker script for PE.
+if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
+ RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+fi
+
cat <<EOF
-OUTPUT_FORMAT(${OUTPUT_FORMAT})
+${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
+${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+
${LIB_SEARCH_DIRS}
ENTRY(_mainCRTStartup)
@@ -12,6 +18,7 @@ SECTIONS
{
${RELOCATING+ *(.init)}
*(.text)
+ ${RELOCATING+*(.text\$*)}
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1); *(.ctors); *(.ctor); LONG (0); }
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
@@ -20,44 +27,40 @@ SECTIONS
/* ??? Why is .gcc_exc here? */
${RELOCATING+ *(.gcc_exc)}
${RELOCATING+ etext = .;}
- /* Grouped section support currently must be explicitly provided for
- in the linker script. */
- *(.text\$)
*(.gcc_except_table)
}
- .bss BLOCK(__section_alignment__) :
- {
- __bss_start__ = . ;
- *(.bss)
- *(COMMON)
- __bss_end__ = . ;
- }
- .data BLOCK(__section_alignment__) :
+ .data ${RELOCATING+BLOCK(__section_alignment__)} :
{
- __data_start__ = . ;
+ ${RELOCATING+__data_start__ = . ;}
*(.data)
*(.data2)
- __data_end__ = . ;
- /* Grouped section support currently must be explicitly provided for
- in the linker script. */
- *(.data\$)
+ ${RELOCATING+*(.data\$*)}
+ ${RELOCATING+__data_end__ = . ;}
+ ${RELOCATING+*(.data_cygwin_nocopy)}
+ }
+
+ .bss ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ ${RELOCATING+__bss_start__ = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+__bss_end__ = . ;}
}
- .rdata BLOCK(__section_alignment__) :
+ .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
{
*(.rdata)
- /* Grouped section support currently must be explicitly provided for
- in the linker script. */
- *(.rdata\$)
+ ${RELOCATING+*(.rdata\$*)}
+ *(.eh_frame)
}
- .edata BLOCK(__section_alignment__) :
+ .edata ${RELOCATING+BLOCK(__section_alignment__)} :
{
*(.edata)
}
- /DISCARD/ BLOCK(__section_alignment__) :
+ /DISCARD/ :
{
*(.debug\$S)
*(.debug\$T)
@@ -65,7 +68,7 @@ SECTIONS
*(.drectve)
}
- .idata BLOCK(__section_alignment__) :
+ .idata ${RELOCATING+BLOCK(__section_alignment__)} :
{
/* This cannot currently be handled with grouped sections.
See pe.em:sort_sections. */
@@ -78,37 +81,35 @@ SECTIONS
*(.idata\$6)
*(.idata\$7)
}
- .CRT BLOCK(__section_alignment__) :
+ .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
{
- /* Grouped sections are used to handle .CRT\$foo. */
- *(.CRT\$)
+ ${RELOCATING+*(.CRT\$*)}
}
- .endjunk BLOCK(__section_alignment__) :
+ .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
{
/* end is deprecated, don't use it */
${RELOCATING+ end = .;}
${RELOCATING+ __end__ = .;}
}
- .reloc BLOCK(__section_alignment__) :
+ .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
{
*(.reloc)
}
- .rsrc BLOCK(__section_alignment__) :
+ .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
{
*(.rsrc)
- /* Grouped sections are used to handle .rsrc\$0[12]. */
- *(.rsrc\$)
+ ${RELOCATING+*(.rsrc\$*)}
}
- .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
}
- .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
{
[ .stabstr ]
}