From 1ddd7b13ed95fd6adb76cdf785bcacdfb1df5441 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 25 Sep 2002 07:21:08 +0000 Subject: [PATCH] * genscripts.sh (SEGMENT_SIZE): Use MAXPAGESIZE before TARGET_PAGE_SIZE. * scripttempl/elf.sc (DATA_SEGMENT_ALIGN): Incorporate SEGMENT_SIZE alignment. * emulparams/elf64ppc.sh (DATA_ADDR): Delete. (SEGMENT_SIZE): Define. --- ld/ChangeLog | 7 +++++++ ld/emulparams/elf64ppc.sh | 2 +- ld/genscripts.sh | 2 +- ld/scripttempl/elf.sc | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 26d5437948c..6eff3797035 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,12 @@ 2002-09-25 Alan Modra + * genscripts.sh (SEGMENT_SIZE): Use MAXPAGESIZE before + TARGET_PAGE_SIZE. + * scripttempl/elf.sc (DATA_SEGMENT_ALIGN): Incorporate + SEGMENT_SIZE alignment. + * emulparams/elf64ppc.sh (DATA_ADDR): Delete. + (SEGMENT_SIZE): Define. + * ldexp.c (fold_unary): New. Split out from exp_fold_tree. (fold_binary): Correct abs - non-abs case. (fold_trinary): New. Split out from exp_fold_tree. diff --git a/ld/emulparams/elf64ppc.sh b/ld/emulparams/elf64ppc.sh index 74185552d02..c849c6530b8 100644 --- a/ld/emulparams/elf64ppc.sh +++ b/ld/emulparams/elf64ppc.sh @@ -5,7 +5,7 @@ GENERATE_SHLIB_SCRIPT=yes SCRIPT_NAME=elf OUTPUT_FORMAT="elf64-powerpc" TEXT_START_ADDR=0x10000000 -DATA_ADDR="ALIGN (0x10000000) + (. & (${MAXPAGESIZE} - 1))" +SEGMENT_SIZE=0x10000000 MAXPAGESIZE=0x40000 COMMONPAGESIZE=0x1000 ARCH=powerpc:common64 diff --git a/ld/genscripts.sh b/ld/genscripts.sh index 36e0a9d588a..ea995510276 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -90,7 +90,7 @@ if [ "x$SCRIPT_NAME" = "xelf" ]; then GENERATE_COMBRELOC_SCRIPT=yes fi -SEGMENT_SIZE=${SEGMENT_SIZE-${TARGET_PAGE_SIZE}} +SEGMENT_SIZE=${SEGMENT_SIZE-${MAXPAGESIZE-${TARGET_PAGE_SIZE}}} # Determine DATA_ALIGNMENT for the 5 variants, using # values specified in the emulparams/.sh file or default. diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 6bbe1b802bb..0c8ddb522bf 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -74,10 +74,10 @@ test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" test "$LD_FLAG" = "N" && DATA_ADDR=. test -n "$CREATE_SHLIB" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" test -z "$CREATE_SHLIB" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" -DATA_SEGMENT_ALIGN="ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))" +DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" DATA_SEGMENT_END="" if test -n "${COMMONPAGESIZE}"; then - DATA_SEGMENT_ALIGN="DATA_SEGMENT_ALIGN(${MAXPAGESIZE}, ${COMMONPAGESIZE})" + DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" fi INTERP=".interp ${RELOCATING-0} : { *(.interp) }" -- 2.30.2