This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
arm-epoc-pe specific linker script added
- To: binutils at sourceware dot cygnus dot com
- Subject: arm-epoc-pe specific linker script added
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Thu, 2 Dec 1999 11:48:51 GMT
Hi Guys,
I have checked in the following patch to add an arm-epoc-pe specific
linker script. This was done so that the contents of the .rdata
section could be added to the end of the .text section. which is
required by the EPOC tools.
Cheers
Nick
1999-12-02 Nick Clifton <nickc@cygnus.com>
* Makefile.am: Fix arm-epoc-pe dependencies.
* Makefile.in: Regenerate.
* emulparams/arm_epoc_pe.sh (SCRIPT_NAME): Set to epocpe.
* scripttempl/epocpe.sc: New file: copy of pe.sc, customised for
EPOC by placing .rdata into .text.
Index: Makefile.am
===================================================================
RCS file: /cvs/binutils/binutils/ld/Makefile.am,v
retrieving revision 1.18
diff -p -r1.18 Makefile.am
*** Makefile.am 1999/09/22 08:32:06 1.18
--- Makefile.am 1999/12/02 11:47:28
*************** earmnbsd.c: $(srcdir)/emulparams/armnbsd
*** 314,320 ****
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
! $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
--- 314,320 ----
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
! $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
Index: Makefile.in
===================================================================
RCS file: /cvs/binutils/binutils/ld/Makefile.in,v
retrieving revision 1.19
diff -p -r1.19 Makefile.in
*** Makefile.in 1999/09/14 13:18:43 1.19
--- Makefile.in 1999/12/02 11:47:28
*************** earmnbsd.c: $(srcdir)/emulparams/armnbsd
*** 1015,1021 ****
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
! $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
--- 1015,1021 ----
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
! $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
earmpe.c: $(srcdir)/emulparams/armpe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
Index: emulparams/arm_epoc_pe.sh
===================================================================
RCS file: /cvs/binutils/binutils/ld/emulparams/arm_epoc_pe.sh,v
retrieving revision 1.3
diff -p -r1.3 arm_epoc_pe.sh
*** arm_epoc_pe.sh 1999/09/12 16:45:16 1.3
--- arm_epoc_pe.sh 1999/12/02 11:47:28
***************
*** 1,5 ****
ARCH=arm
! SCRIPT_NAME=pe
OUTPUT_FORMAT="epoc-pei-arm-little"
LITTLE_OUTPUT_FORMAT="epoc-pei-arm-little"
BIG_OUTPUT_FORMAT="epoc-pei-arm-big"
--- 1,5 ----
ARCH=arm
! SCRIPT_NAME=epocpe
OUTPUT_FORMAT="epoc-pei-arm-little"
LITTLE_OUTPUT_FORMAT="epoc-pei-arm-little"
BIG_OUTPUT_FORMAT="epoc-pei-arm-big"
Index: scripttempl/epocpe.sc
===================================================================
RCS file: epocpe.sc
diff -N epocpe.sc
*** /dev/null Tue May 5 13:32:27 1998
--- epocpe.sc Thu Dec 2 03:47:28 1999
***************
*** 0 ****
--- 1,151 ----
+ # Linker script for PE.
+
+ if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
+ RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+ fi
+
+ # We can't easily and portably get an unquoted $ in a shell
+ # substitution, so we do this instead.
+ # Sorting of the .foo$* sections is required by the definition of
+ # grouped sections in PE.
+ # Sorting of the file names in R_IDATA is required by the
+ # current implementation of dlltool (this could probably be changed to
+ # use grouped sections instead).
+ if test "${RELOCATING}"; then
+ R_TEXT='*(SORT(.text$*))'
+ R_DATA='*(SORT(.data$*))'
+ R_RDATA='*(SORT(.rdata$*))'
+ R_IDATA='
+ SORT(*)(.idata$2)
+ SORT(*)(.idata$3)
+ /* These zeroes mark the end of the import list. */
+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
+ SORT(*)(.idata$4)
+ SORT(*)(.idata$5)
+ SORT(*)(.idata$6)
+ SORT(*)(.idata$7)'
+ R_CRT='*(SORT(.CRT$*))'
+ R_RSRC='*(SORT(.rsrc$*))'
+ else
+ R_TEXT=
+ R_DATA=
+ R_RDATA=
+ R_IDATA=
+ R_CRT=
+ R_RSRC=
+ fi
+
+ cat <<EOF
+ ${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
+ ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+
+ ${LIB_SEARCH_DIRS}
+
+ ENTRY(_mainCRTStartup)
+
+ SECTIONS
+ {
+ .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
+ {
+ ${RELOCATING+ *(.init)}
+ *(.text)
+ ${R_TEXT}
+ *(.glue_7t)
+ *(.glue_7)
+ ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
+ LONG (-1); *(.ctors); *(.ctor); LONG (0); }
+ ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
+ LONG (-1); *(.dtors); *(.dtor); LONG (0); }
+ ${RELOCATING+ *(.fini)}
+ /* ??? Why is .gcc_exc here? */
+ ${RELOCATING+ *(.gcc_exc)}
+ ${RELOCATING+ etext = .;}
+ *(.gcc_except_table)
+
+ /* For EPOC the read only data is located at the end of the .text
+ section */
+ *(.rdata)
+ ${R_RDATA}
+ *(.eh_frame)
+ }
+
+ /* The Cygwin32 library uses a section to avoid copying certain data
+ on fork. This used to be named ".data$nocopy". The linker used
+ to include this between __data_start__ and __data_end__, but that
+ breaks building the cygwin32 dll. Instead, we name the section
+ ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+
+ .data ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ ${RELOCATING+__data_start__ = . ;}
+ *(.data)
+ *(.data2)
+ ${R_DATA}
+ ${RELOCATING+__data_end__ = . ;}
+ ${RELOCATING+*(.data_cygwin_nocopy)}
+ }
+
+ .bss ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ ${RELOCATING+__bss_start__ = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+__bss_end__ = . ;}
+ }
+
+ .edata ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ *(.edata)
+ }
+
+ /DISCARD/ :
+ {
+ *(.debug\$S)
+ *(.debug\$T)
+ *(.debug\$F)
+ *(.drectve)
+ }
+
+ .idata ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ /* This cannot currently be handled with grouped sections.
+ See pe.em:sort_sections. */
+ ${R_IDATA}
+ }
+
+ .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ ${R_CRT}
+ }
+
+ .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ /* end is deprecated, don't use it */
+ ${RELOCATING+ end = .;}
+ ${RELOCATING+ _end = .;}
+ ${RELOCATING+ __end__ = .;}
+ }
+
+ .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ *(.reloc)
+ }
+
+ .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
+ {
+ *(.rsrc)
+ ${R_RSRC}
+ }
+
+ .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+ .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+
+ }
+ EOF