From 03098a9a6099730e34f4e6b20b8201030a0fd59a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 28 Sep 2004 19:14:29 +0000 Subject: [PATCH] * emulparams/arm_epoc_pe.sh, emulparams/armpe.sh, emulparams/i386pe.sh, emulparams/i386pe_posix.sh, emulparams/mcorepe.sh, emulparams/mipspe.sh, emulparams/ppcpe.sh, scripttempl/pe.sc: Define TARGET_PAGE_SIZE. * scripttempl/pe.sc: Make the virtual address and file offset synced if the alignment is lower than the target page size. --- ld/ChangeLog | 9 +++++++++ ld/emulparams/arm_epoc_pe.sh | 1 + ld/emulparams/armpe.sh | 2 ++ ld/emulparams/i386pe.sh | 1 + ld/emulparams/i386pe_posix.sh | 1 + ld/emulparams/mcorepe.sh | 1 + ld/emulparams/mipspe.sh | 1 + ld/emulparams/ppcpe.sh | 1 + ld/emulparams/shpe.sh | 1 + ld/scripttempl/pe.sc | 6 +++++- 10 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 68f359de5b0..0c6f1e83c92 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2004-09-18 Filip Navara + + * emulparams/arm_epoc_pe.sh, emulparams/armpe.sh, emulparams/i386pe.sh, + emulparams/i386pe_posix.sh, emulparams/mcorepe.sh, + emulparams/mipspe.sh, emulparams/ppcpe.sh, scripttempl/pe.sc: Define + TARGET_PAGE_SIZE. + * scripttempl/pe.sc: Make the virtual address and file offset synced if + the alignment is lower than the target page size. + 2004-09-27 Filip Navara * emultempl/pe.em (gld_${EMULATION_NAME}_unrecognized_file): Allow diff --git a/ld/emulparams/arm_epoc_pe.sh b/ld/emulparams/arm_epoc_pe.sh index 04fa22db879..7cc4b220fae 100644 --- a/ld/emulparams/arm_epoc_pe.sh +++ b/ld/emulparams/arm_epoc_pe.sh @@ -7,3 +7,4 @@ TEMPLATE_NAME=pe ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/armpe.sh b/ld/emulparams/armpe.sh index aa605366e8c..5db5faf3468 100644 --- a/ld/emulparams/armpe.sh +++ b/ld/emulparams/armpe.sh @@ -11,3 +11,5 @@ TEMPLATE_NAME=pe ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" + +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/i386pe.sh b/ld/emulparams/i386pe.sh index a8add23d6d1..879379f9c5d 100644 --- a/ld/emulparams/i386pe.sh +++ b/ld/emulparams/i386pe.sh @@ -6,3 +6,4 @@ TEMPLATE_NAME=pe ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/i386pe_posix.sh b/ld/emulparams/i386pe_posix.sh index 37f51b5eeea..afa00de0cdf 100644 --- a/ld/emulparams/i386pe_posix.sh +++ b/ld/emulparams/i386pe_posix.sh @@ -7,3 +7,4 @@ ENTRY="___PosixProcessStartup" SUBSYSTEM=7 EXECUTABLE_NAME=a.out INITIAL_SYMBOL_CHAR=\"_\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/mcorepe.sh b/ld/emulparams/mcorepe.sh index 3c19e02ca1e..8326c2e5144 100644 --- a/ld/emulparams/mcorepe.sh +++ b/ld/emulparams/mcorepe.sh @@ -7,3 +7,4 @@ TEMPLATE_NAME=pe ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/mipspe.sh b/ld/emulparams/mipspe.sh index 9dd9ce761ef..a5cfc2ef60e 100644 --- a/ld/emulparams/mipspe.sh +++ b/ld/emulparams/mipspe.sh @@ -7,3 +7,4 @@ TEMPLATE_NAME=pe SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" ENTRY="_mainCRTStartup" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/ppcpe.sh b/ld/emulparams/ppcpe.sh index a2d09ef2238..2e1e10207c8 100644 --- a/ld/emulparams/ppcpe.sh +++ b/ld/emulparams/ppcpe.sh @@ -5,3 +5,4 @@ TEMPLATE_NAME=pe ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emulparams/shpe.sh b/ld/emulparams/shpe.sh index 44aeef33be4..d50861f55d5 100644 --- a/ld/emulparams/shpe.sh +++ b/ld/emulparams/shpe.sh @@ -7,3 +7,4 @@ INITIAL_SYMBOL_CHAR=\"_\" ENTRY="_mainCRTStartup" SUBSYSTEM=PE_DEF_SUBSYSTEM INITIAL_SYMBOL_CHAR=\"_\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index c6e25f50bee..8cbfe352e4a 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -54,7 +54,11 @@ ENTRY(${ENTRY}) SECTIONS { - .text ${RELOCATING+ __image_base__ + __section_alignment__ } : + ${RELOCATING+/* Make the virtual address and file offset synced if the alignment is} + ${RELOCATING+ lower than the target page size. */} + ${RELOCATING+. = SIZEOF_HEADERS;} + ${RELOCATING+. = ALIGN(__section_alignment__);} + .text ${RELOCATING+ __image_base__ + ( __section_alignment__ < ${TARGET_PAGE_SIZE} ? . : __section_alignment__ )} : { ${RELOCATING+ *(.init)} *(.text) -- 2.30.2