X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ld%2Fscripttempl%2Fpe.sc;h=ce1a502f71764e203726d0045794059e4c614c1e;hb=f6dc23a9315643df7775395ab7518490e5da6a1c;hp=cc9e78ecf3ff48a77060eda289bde6b30f3fcde0;hpb=eb7f87c5c840602725dd013935eb6a558624f16a;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index cc9e78ecf3..ce1a502f71 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -1,97 +1,157 @@ # Linker script for PE. -# These are substituted in as variables in order to get '}' in a shell -# conditional expansion. -INIT='.init : { *(.init) }' -FINI='.fini : { *(.fini) }' + +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 <