X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=ld%2Fscripttempl%2Fpe.sc;h=c9eb16f6dc2d1fb1d0d9bb9eaac254367f42b4f4;hb=5f294ed6805ce3931f9c04cfedff38e20010c819;hp=b49756170a517740c14b955dae68fda95d2b80b6;hpb=94d8217d652d28bf71ba768b142f5cc51086111e;p=binutils-gdb.git diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index b49756170a5..c9eb16f6dc2 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -1,63 +1,127 @@ # 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_XC='*(SORT(.CRT$XC*)) /* C initialization */' + R_CRT_XI='*(SORT(.CRT$XI*)) /* C++ initialization */' + R_CRT_XL='*(SORT(.CRT$XL*)) /* TLS callbacks */' + R_CRT_XP='*(SORT(.CRT$XP*)) /* Pre-termination */' + R_CRT_XT='*(SORT(.CRT$XT*)) /* Termination */' + R_TLS=' + *(.tls) + *(.tls$) + *(SORT(.tls$*))' + R_RSRC='*(SORT(.rsrc$*))' +else + R_TEXT= + R_DATA= + R_RDATA= + R_IDATA= + R_CRT= + R_RSRC= +fi + cat <