aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog92
-rw-r--r--ld/emulparams/arcelf.sh2
-rw-r--r--ld/emulparams/armelf_linux.sh4
-rw-r--r--ld/emulparams/armelf_nbsd.sh2
-rw-r--r--ld/emulparams/armelf_vxworks.sh2
-rw-r--r--ld/emulparams/armnto.sh2
-rw-r--r--ld/emulparams/armsymbian.sh5
-rwxr-xr-xld/emulparams/bfin.sh2
-rw-r--r--ld/emulparams/crislinux.sh2
-rw-r--r--ld/emulparams/elf32_i860.sh2
-rw-r--r--ld/emulparams/elf32_i960.sh2
-rw-r--r--ld/emulparams/elf32_sparc.sh4
-rw-r--r--ld/emulparams/elf32am33lin.sh2
-rw-r--r--ld/emulparams/elf32bfinfd.sh2
-rw-r--r--ld/emulparams/elf32bmip.sh4
-rw-r--r--ld/emulparams/elf32bmipn32-defs.sh2
-rwxr-xr-xld/emulparams/elf32bmipn32.sh2
-rw-r--r--ld/emulparams/elf32btsmipn32.sh2
-rw-r--r--ld/emulparams/elf32frvfd.sh2
-rw-r--r--ld/emulparams/elf32i370.sh2
-rw-r--r--ld/emulparams/elf32lppcnto.sh2
-rw-r--r--ld/emulparams/elf32mcore.sh2
-rwxr-xr-xld/emulparams/elf32openrisc.sh2
-rw-r--r--ld/emulparams/elf32ppccommon.sh4
-rw-r--r--ld/emulparams/elf32ppcnto.sh2
-rw-r--r--ld/emulparams/elf32ppcwindiss.sh2
-rw-r--r--ld/emulparams/elf32vax.sh2
-rw-r--r--ld/emulparams/elf32xc16x.sh2
-rw-r--r--ld/emulparams/elf32xc16xl.sh2
-rw-r--r--ld/emulparams/elf32xc16xs.sh2
-rw-r--r--ld/emulparams/elf64_aix.sh2
-rw-r--r--ld/emulparams/elf64_ia64.sh4
-rw-r--r--ld/emulparams/elf64_s390.sh4
-rw-r--r--ld/emulparams/elf64_sparc.sh4
-rw-r--r--ld/emulparams/elf64alpha.sh4
-rwxr-xr-xld/emulparams/elf64hppa.sh2
-rw-r--r--ld/emulparams/elf64mmix.sh6
-rw-r--r--ld/emulparams/elf64ppc.sh4
-rw-r--r--ld/emulparams/elf_i386.sh4
-rw-r--r--ld/emulparams/elf_i386_be.sh2
-rw-r--r--ld/emulparams/elf_i386_chaos.sh2
-rw-r--r--ld/emulparams/elf_i386_ldso.sh2
-rw-r--r--ld/emulparams/elf_i386_vxworks.sh4
-rw-r--r--ld/emulparams/elf_s390.sh4
-rw-r--r--ld/emulparams/elf_x86_64.sh4
-rw-r--r--ld/emulparams/hppa64linux.sh2
-rw-r--r--ld/emulparams/hppalinux.sh2
-rw-r--r--ld/emulparams/hppaobsd.sh2
-rw-r--r--ld/emulparams/i386lynx.sh2
-rw-r--r--ld/emulparams/i386moss.sh2
-rw-r--r--ld/emulparams/i386nto.sh2
-rw-r--r--ld/emulparams/i386nw.sh2
-rw-r--r--ld/emulparams/m32relf_linux.sh2
-rw-r--r--ld/emulparams/m68kelf.sh2
-rw-r--r--ld/emulparams/m68kpsos.sh2
-rw-r--r--ld/emulparams/or32elf.sh2
-rw-r--r--ld/emulparams/pjelf.sh2
-rw-r--r--ld/emulparams/pjlelf.sh2
-rw-r--r--ld/emulparams/ppclynx.sh2
-rw-r--r--ld/emulparams/ppcnw.sh2
-rw-r--r--ld/emulparams/shelf32_nbsd.sh2
-rw-r--r--ld/emulparams/shelf_nbsd.sh2
-rw-r--r--ld/emulparams/shelf_nto.sh2
-rw-r--r--ld/emulparams/shlelf32_linux.sh4
-rw-r--r--ld/emulparams/shlelf_linux.sh4
-rw-r--r--ld/emulparams/shlelf_nto.sh2
-rw-r--r--ld/emulparams/xtensa-config.sh2
-rw-r--r--ld/emultempl/elf32.em18
-rw-r--r--ld/ld.h6
-rw-r--r--ld/ld.texinfo6
-rw-r--r--ld/ldexp.c11
-rw-r--r--ld/ldgram.y3
-rw-r--r--ld/ldlex.l1
-rw-r--r--ld/ldmain.c10
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-elf/binutils.exp80
-rw-r--r--ld/testsuite/ld-elf/commonpage1.d8
-rw-r--r--ld/testsuite/ld-elf/maxpage1.d8
-rw-r--r--ld/testsuite/ld-elf/maxpage1.s7
79 files changed, 338 insertions, 88 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 42d6864..0c75415 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,95 @@
+2006-05-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emulparams/arcelf.sh (MAXPAGESIZE): Changed to
+ "CONSTANT (MAXPAGESIZE)".
+ * emulparams/armelf_nbsd.sh: Likewise.
+ * emulparams/armelf_vxworks.sh: Likewise.
+ * emulparams/armnto.sh: Likewise.
+ * emulparams/armsymbian.sh: Likewise.
+ * emulparams/crislinux.sh: Likewise.
+ * emulparams/elf32_i860.sh: Likewise.
+ * emulparams/elf32_i960.sh: Likewise.
+ * emulparams/elf32am33lin.sh: Likewise.
+ * emulparams/elf32bfinfd.sh: Likewise.
+ * emulparams/elf32bmipn32-defs.sh: Likewise.
+ * emulparams/elf32frvfd.sh: Likewise.
+ * emulparams/elf32i370.sh: Likewise.
+ * emulparams/elf32lppcnto.sh: Likewise.
+ * emulparams/elf32mcore.sh: Likewise.
+ * emulparams/elf32openrisc.sh: Likewise.
+ * emulparams/elf32ppcnto.sh: Likewise.
+ * emulparams/elf32ppcwindiss.sh: Likewise.
+ * emulparams/elf32vax.sh: Likewise.
+ * emulparams/elf32xc16x.sh: Likewise.
+ * emulparams/elf32xc16xl.sh: Likewise.
+ * emulparams/elf32xc16xs.sh: Likewise.
+ * emulparams/elf64_aix.sh: Likewise.
+ * emulparams/elf64hppa.sh: Likewise.
+ * emulparams/elf64mmix.sh: Likewise.
+ * emulparams/elf_i386_be.sh: Likewise.
+ * emulparams/elf_i386_chaos.sh: Likewise.
+ * emulparams/elf_i386_ldso.sh: Likewise.
+ * emulparams/hppa64linux.sh: Likewise.
+ * emulparams/hppalinux.sh: Likewise.
+ * emulparams/hppaobsd.sh: Likewise.
+ * emulparams/i386lynx.sh: Likewise.
+ * emulparams/i386moss.sh: Likewise.
+ * emulparams/i386nto.sh: Likewise.
+ * emulparams/i386nw.sh: Likewise.
+ * emulparams/m32relf_linux.sh: Likewise.
+ * emulparams/m68kpsos.sh: Likewise.
+ * emulparams/or32elf.sh: Likewise.
+ * emulparams/pjelf.sh: Likewise.
+ * emulparams/pjlelf.sh: Likewise.
+ * emulparams/ppclynx.sh: Likewise.
+ * emulparams/ppcnw.sh: Likewise.
+ * emulparams/shelf32_nbsd.sh : Likewise.
+ * emulparams/shelf_nbsd.sh: Likewise.
+ * emulparams/shelf_nto.sh: Likewise.
+ * emulparams/shlelf_nto.sh: Likewise.
+ * emulparams/xtensa-config.sh: Likewise.
+
+ * emulparams/armelf_linux.sh (MAXPAGESIZE): Changed to
+ "CONSTANT (MAXPAGESIZE)".
+ (COMMONPAGESIZE): Changed to "CONSTANT (COMMONPAGESIZE)".
+ * emulparams/elf32_sparc.sh: Likewise.
+ * emulparams/elf32bmip.sh: Likewise.
+ * emulparams/elf32ppccommon.sh: Likewise.
+ * emulparams/elf64_ia64.sh: Likewise.
+ * emulparams/elf64_s390.sh: Likewise.
+ * emulparams/elf64_sparc.sh: Likewise.
+ * emulparams/elf64alpha.sh: Likewise.
+ * emulparams/elf64ppc.sh: Likewise.
+ * emulparams/elf_i386.sh: Likewise.
+ * emulparams/elf_i386_vxworks.sh: Likewise.
+ * emulparams/elf_s390.sh: Likewise.
+ * emulparams/elf_x86_64.sh: Likewise.
+ * emulparams/shlelf32_linux.sh: Likewise.
+ * emulparams/shlelf_linux.sh: Likewise.
+
+ * emulparams/elf32bmipn32.sh (COMMONPAGESIZE): Changed to
+ "CONSTANT (COMMONPAGESIZE)".
+ * emulparams/elf32btsmipn32.sh: Likewise.
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Add
+ "-z max-page-size=" and "-z common-page-size=".
+ (gld${EMULATION_NAME}_list_options): Likewise.
+
+ * ld.h (ld_config_type): Add maxpagesize and commonpagesize.
+
+ * ld.texinfo: Document "-z max-page-size=" and
+ "-z common-page-size=".
+
+ * ldexp.c (exp_print_token): Handle CONSTANT.
+ (fold_name): Likewise.
+ * ldgram.y: Likewise.
+ * ldlex.l: Likewise.
+
+ * ldmain.c (main): Initiliaze config.maxpagesize and
+ config.commonpagesize. Call bfd_emul_set_maxpagesize if
+ config.maxpagesize isn't 0. Call bfd_emul_set_commonpagesize if
+ config.commonpagesize config.maxpagesize isn't 0.
+
2006-05-30 Nick Clifton <nickc@redhat.com>
* po/es.po: Updated Spanish translation.
diff --git a/ld/emulparams/arcelf.sh b/ld/emulparams/arcelf.sh
index b1c9c17..f023093 100644
--- a/ld/emulparams/arcelf.sh
+++ b/ld/emulparams/arcelf.sh
@@ -3,7 +3,7 @@ OUTPUT_FORMAT="elf32-littlearc"
LITTLE_OUTPUT_FORMAT="elf32-littlearc"
BIG_OUTPUT_FORMAT="elf32-bigarc"
TEXT_START_ADDR=0x0
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x0
ARCH=arc
MACHINE=
diff --git a/ld/emulparams/armelf_linux.sh b/ld/emulparams/armelf_linux.sh
index 39b7f65..e7c8025 100644
--- a/ld/emulparams/armelf_linux.sh
+++ b/ld/emulparams/armelf_linux.sh
@@ -3,8 +3,8 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-littlearm"
BIG_OUTPUT_FORMAT="elf32-bigarm"
LITTLE_OUTPUT_FORMAT="elf32-littlearm"
-MAXPAGESIZE=0x8000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=armelf
GENERATE_SHLIB_SCRIPT=yes
diff --git a/ld/emulparams/armelf_nbsd.sh b/ld/emulparams/armelf_nbsd.sh
index 3d94839..517cd62 100644
--- a/ld/emulparams/armelf_nbsd.sh
+++ b/ld/emulparams/armelf_nbsd.sh
@@ -1,5 +1,5 @@
. ${srcdir}/emulparams/armelf.sh
-MAXPAGESIZE=0x8000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR=0x00008000
TARGET2_TYPE=got-rel
diff --git a/ld/emulparams/armelf_vxworks.sh b/ld/emulparams/armelf_vxworks.sh
index 7b6445e..ca5c907 100644
--- a/ld/emulparams/armelf_vxworks.sh
+++ b/ld/emulparams/armelf_vxworks.sh
@@ -2,5 +2,5 @@
OUTPUT_FORMAT="elf32-littlearm-vxworks"
BIG_OUTPUT_FORMAT="elf32-bigarm-vxworks"
LITTLE_OUTPUT_FORMAT="$OUTPUT_FORMAT"
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
. ${srcdir}/emulparams/vxworks.sh
diff --git a/ld/emulparams/armnto.sh b/ld/emulparams/armnto.sh
index 6429612..6891e63 100644
--- a/ld/emulparams/armnto.sh
+++ b/ld/emulparams/armnto.sh
@@ -17,7 +17,7 @@ GENERATE_SHLIB_SCRIPT=yes
ARCH=arm
MACHINE=
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=_start
diff --git a/ld/emulparams/armsymbian.sh b/ld/emulparams/armsymbian.sh
index a52d05b..3d7e864 100644
--- a/ld/emulparams/armsymbian.sh
+++ b/ld/emulparams/armsymbian.sh
@@ -19,7 +19,4 @@ OTHER_READONLY_SECTIONS="
${RELOCATING+ __exidx_end = .; }
${RELOCATING+ .ARM.exidx\$\$Limit = . ; }"
-# This value should match ELF_MAXPAGESIZE in BFD. Otherwise, elf.c
-# will not place read-write sections in a separate ELF segment from
-# the read-only sections.
-MAXPAGESIZE=0x8000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
diff --git a/ld/emulparams/bfin.sh b/ld/emulparams/bfin.sh
index 5e7adda..b7695a4 100755
--- a/ld/emulparams/bfin.sh
+++ b/ld/emulparams/bfin.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-bfin"
TEXT_START_ADDR=0x0
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TARGET_PAGE_SIZE=0x1000
NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR}
ARCH=bfin
diff --git a/ld/emulparams/crislinux.sh b/ld/emulparams/crislinux.sh
index 98d12f3..e41024c 100644
--- a/ld/emulparams/crislinux.sh
+++ b/ld/emulparams/crislinux.sh
@@ -14,7 +14,7 @@ GENERATE_SHLIB_SCRIPT=yes
# Is this high enough and low enough?
TEXT_START_ADDR=0x80000
-MAXPAGESIZE=8192
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
# We don't do the hoops through DEFINED to provide [_]*start, as it
# doesn't work with --gc-sections, and the start-name is pretty fixed
diff --git a/ld/emulparams/elf32_i860.sh b/ld/emulparams/elf32_i860.sh
index 6769fa5..1ab4204 100644
--- a/ld/emulparams/elf32_i860.sh
+++ b/ld/emulparams/elf32_i860.sh
@@ -5,5 +5,5 @@ BIG_OUTPUT_FORMAT="elf32-i860"
LITTLE_OUTPUT_FORMAT="elf32-i860-little"
TEXT_START_ADDR=0
PAGE_SIZE=0x1000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=i860
diff --git a/ld/emulparams/elf32_i960.sh b/ld/emulparams/elf32_i960.sh
index 10ec3fa..1ef7292 100644
--- a/ld/emulparams/elf32_i960.sh
+++ b/ld/emulparams/elf32_i960.sh
@@ -5,4 +5,4 @@ ARCH=i960
MACHINE=
TEXT_START_ADDR=0
EMBEDDED=yes
-MAXPAGESIZE=0x2000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
diff --git a/ld/emulparams/elf32_sparc.sh b/ld/emulparams/elf32_sparc.sh
index af23252..1d31d22 100644
--- a/ld/emulparams/elf32_sparc.sh
+++ b/ld/emulparams/elf32_sparc.sh
@@ -1,8 +1,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sparc"
TEXT_START_ADDR=0x10000
-MAXPAGESIZE=0x10000
-COMMONPAGESIZE=0x2000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x10000
ALIGNMENT=8
ARCH=sparc
diff --git a/ld/emulparams/elf32am33lin.sh b/ld/emulparams/elf32am33lin.sh
index f8b3a89..31dbc70 100644
--- a/ld/emulparams/elf32am33lin.sh
+++ b/ld/emulparams/elf32am33lin.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-am33lin"
TEXT_START_ADDR=0x8000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x8000000
ARCH=mn10300
MACHINE=
diff --git a/ld/emulparams/elf32bfinfd.sh b/ld/emulparams/elf32bfinfd.sh
index 9047c6a..19ec748 100644
--- a/ld/emulparams/elf32bfinfd.sh
+++ b/ld/emulparams/elf32bfinfd.sh
@@ -1,7 +1,7 @@
. ${srcdir}/emulparams/bfin.sh
unset STACK_ADDR
OUTPUT_FORMAT="elf32-bfinfdpic"
-MAXPAGESIZE=0x4000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf32bmip.sh b/ld/emulparams/elf32bmip.sh
index 5da3049..7260be0 100644
--- a/ld/emulparams/elf32bmip.sh
+++ b/ld/emulparams/elf32bmip.sh
@@ -7,8 +7,8 @@ BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
TEXT_START_ADDR=0x0400000
test -n "${EMBEDDED}" || DATA_ADDR=0x10000000
-MAXPAGESIZE=0x40000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000
TEXT_DYNAMIC=
diff --git a/ld/emulparams/elf32bmipn32-defs.sh b/ld/emulparams/elf32bmipn32-defs.sh
index b81ac49..8f56ccf 100644
--- a/ld/emulparams/elf32bmipn32-defs.sh
+++ b/ld/emulparams/elf32bmipn32-defs.sh
@@ -33,7 +33,7 @@ GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x100000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=__start
# GOT-related settings.
diff --git a/ld/emulparams/elf32bmipn32.sh b/ld/emulparams/elf32bmipn32.sh
index a320eb2..c26b6b3 100755
--- a/ld/emulparams/elf32bmipn32.sh
+++ b/ld/emulparams/elf32bmipn32.sh
@@ -3,7 +3,7 @@ OUTPUT_FORMAT="elf32-nbigmips"
BIG_OUTPUT_FORMAT="elf32-nbigmips"
LITTLE_OUTPUT_FORMAT="elf32-nlittlemips"
SHLIB_TEXT_START_ADDR=0x5ffe0000
-COMMONPAGESIZE=0x1000
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
# IRIX6 defines these symbols. 0x34 is the size of the ELF header.
EXECUTABLE_SYMBOLS="
diff --git a/ld/emulparams/elf32btsmipn32.sh b/ld/emulparams/elf32btsmipn32.sh
index 5ca6797..10c5565 100644
--- a/ld/emulparams/elf32btsmipn32.sh
+++ b/ld/emulparams/elf32btsmipn32.sh
@@ -5,7 +5,7 @@
OUTPUT_FORMAT="elf32-ntradbigmips"
BIG_OUTPUT_FORMAT="elf32-ntradbigmips"
LITTLE_OUTPUT_FORMAT="elf32-ntradlittlemips"
-COMMONPAGESIZE=0x1000
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
# Magic sections.
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
diff --git a/ld/emulparams/elf32frvfd.sh b/ld/emulparams/elf32frvfd.sh
index 42b36f7..7029d47 100644
--- a/ld/emulparams/elf32frvfd.sh
+++ b/ld/emulparams/elf32frvfd.sh
@@ -1,7 +1,7 @@
. ${srcdir}/emulparams/elf32frv.sh
unset STACK_ADDR
OUTPUT_FORMAT="elf32-frvfdpic"
-MAXPAGESIZE=0x4000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf32i370.sh b/ld/emulparams/elf32i370.sh
index d9d5d85..425238c 100644
--- a/ld/emulparams/elf32i370.sh
+++ b/ld/emulparams/elf32i370.sh
@@ -3,6 +3,6 @@ GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elfi370
OUTPUT_FORMAT="elf32-i370"
TEXT_START_ADDR=0x01800000
-MAXPAGESIZE=0x40000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=i370
MACHINE=
diff --git a/ld/emulparams/elf32lppcnto.sh b/ld/emulparams/elf32lppcnto.sh
index 1f19055..c45260d 100644
--- a/ld/emulparams/elf32lppcnto.sh
+++ b/ld/emulparams/elf32lppcnto.sh
@@ -1,5 +1,5 @@
. ${srcdir}/emulparams/elf32ppc.sh
OUTPUT_FORMAT="elf32-powerpcle"
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR=0x48040000
diff --git a/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh
index 930a9c3..6d9f2d6 100644
--- a/ld/emulparams/elf32mcore.sh
+++ b/ld/emulparams/elf32mcore.sh
@@ -4,7 +4,7 @@ BIG_OUTPUT_FORMAT="elf32-mcore-big"
LITTLE_OUTPUT_FORMAT="elf32-mcore-little"
PAGE_SIZE=0x1000
TARGET_PAGE_SIZE=0x400
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR=0
NONPAGED_TEXT_START_ADDR=0
ARCH=mcore
diff --git a/ld/emulparams/elf32openrisc.sh b/ld/emulparams/elf32openrisc.sh
index a65dcd8..53e88dd 100755
--- a/ld/emulparams/elf32openrisc.sh
+++ b/ld/emulparams/elf32openrisc.sh
@@ -3,7 +3,7 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-openrisc"
TEXT_START_ADDR=0x10000
ARCH=openrisc
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=_start
EMBEDDED=yes
NOP=0x15000000
diff --git a/ld/emulparams/elf32ppccommon.sh b/ld/emulparams/elf32ppccommon.sh
index b5fbc8d..1a12890 100644
--- a/ld/emulparams/elf32ppccommon.sh
+++ b/ld/emulparams/elf32ppccommon.sh
@@ -6,8 +6,8 @@ GENERATE_PIE_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x01800000
-MAXPAGESIZE=0x10000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH=powerpc:common
MACHINE=
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
diff --git a/ld/emulparams/elf32ppcnto.sh b/ld/emulparams/elf32ppcnto.sh
index dd4a79c..d0b3e3d 100644
--- a/ld/emulparams/elf32ppcnto.sh
+++ b/ld/emulparams/elf32ppcnto.sh
@@ -1,4 +1,4 @@
. ${srcdir}/emulparams/elf32ppc.sh
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR=0x48040000
diff --git a/ld/emulparams/elf32ppcwindiss.sh b/ld/emulparams/elf32ppcwindiss.sh
index c0e6138..d217de9 100644
--- a/ld/emulparams/elf32ppcwindiss.sh
+++ b/ld/emulparams/elf32ppcwindiss.sh
@@ -4,7 +4,7 @@ OUTPUT_FORMAT="elf32-powerpc"
ARCH=powerpc
MACHINE=
EMBEDDED=yes
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
# The data below is taken from the windiss.dld linker script that comes with
# the Diab linker.
diff --git a/ld/emulparams/elf32vax.sh b/ld/emulparams/elf32vax.sh
index 56bbab7..42e846f 100644
--- a/ld/emulparams/elf32vax.sh
+++ b/ld/emulparams/elf32vax.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-vax"
TEXT_START_ADDR=0x10000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x1000
ARCH=vax
MACHINE=
diff --git a/ld/emulparams/elf32xc16x.sh b/ld/emulparams/elf32xc16x.sh
index 808feed..f88ccee 100644
--- a/ld/emulparams/elf32xc16x.sh
+++ b/ld/emulparams/elf32xc16x.sh
@@ -3,6 +3,6 @@ TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf32-xc16x"
TEXT_START_ADDR=0x00400
ARCH=xc16x
-MAXPAGESIZE=256
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=_start
EMBEDDED=yes
diff --git a/ld/emulparams/elf32xc16xl.sh b/ld/emulparams/elf32xc16xl.sh
index 333f2a6..14eb24b 100644
--- a/ld/emulparams/elf32xc16xl.sh
+++ b/ld/emulparams/elf32xc16xl.sh
@@ -3,6 +3,6 @@ TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf32-xc16x"
TEXT_START_ADDR=0xc00300
ARCH=xc16x:xc16xl
-MAXPAGESIZE=256
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=_start
EMBEDDED=yes
diff --git a/ld/emulparams/elf32xc16xs.sh b/ld/emulparams/elf32xc16xs.sh
index df36f41..2454963 100644
--- a/ld/emulparams/elf32xc16xs.sh
+++ b/ld/emulparams/elf32xc16xs.sh
@@ -3,6 +3,6 @@ TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf32-xc16x"
TEXT_START_ADDR=0xc00300
ARCH=xc16x:xc16xs
-MAXPAGESIZE=256
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=_start
EMBEDDED=yes
diff --git a/ld/emulparams/elf64_aix.sh b/ld/emulparams/elf64_aix.sh
index 738fea9..39325f5 100644
--- a/ld/emulparams/elf64_aix.sh
+++ b/ld/emulparams/elf64_aix.sh
@@ -5,7 +5,7 @@ TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf64-ia64-aix-little"
ARCH=ia64
MACHINE=
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR="0x10000000"
DATA_ADDR="ALIGN (0x10000000) + (. & (${MAXPAGESIZE} - 1))"
GENERATE_SHLIB_SCRIPT=yes
diff --git a/ld/emulparams/elf64_ia64.sh b/ld/emulparams/elf64_ia64.sh
index c5be56e..7e5e54d 100644
--- a/ld/emulparams/elf64_ia64.sh
+++ b/ld/emulparams/elf64_ia64.sh
@@ -6,12 +6,12 @@ EXTRA_EM_FILE=ia64elf
OUTPUT_FORMAT="elf64-ia64-little"
ARCH=ia64
MACHINE=
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
# FIXME: It interferes with linker relaxation. Disable it until it is
# fixed.
if test "0" = "1" -a -n "$CREATE_SHLIB"; then
# Optimize shared libraries for 16K page size
- COMMONPAGESIZE=0x4000
+ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
fi
TEXT_START_ADDR="0x4000000000000000"
DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))"
diff --git a/ld/emulparams/elf64_s390.sh b/ld/emulparams/elf64_s390.sh
index ea75d31..a26bbb6 100644
--- a/ld/emulparams/elf64_s390.sh
+++ b/ld/emulparams/elf64_s390.sh
@@ -2,8 +2,8 @@ SCRIPT_NAME=elf
ELFSIZE=64
OUTPUT_FORMAT="elf64-s390"
TEXT_START_ADDR=0x80000000
-MAXPAGESIZE=0x1000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x80000000
ARCH="s390:64-bit"
MACHINE=
diff --git a/ld/emulparams/elf64_sparc.sh b/ld/emulparams/elf64_sparc.sh
index 0c0f5d8..cef4bff 100644
--- a/ld/emulparams/elf64_sparc.sh
+++ b/ld/emulparams/elf64_sparc.sh
@@ -2,8 +2,8 @@ SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf64-sparc"
-MAXPAGESIZE=0x100000
-COMMONPAGESIZE=0x2000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH="sparc:v9"
MACHINE=
DATA_PLT=
diff --git a/ld/emulparams/elf64alpha.sh b/ld/emulparams/elf64alpha.sh
index 47a0bb0..2c3b7d4 100644
--- a/ld/emulparams/elf64alpha.sh
+++ b/ld/emulparams/elf64alpha.sh
@@ -5,8 +5,8 @@ TEMPLATE_NAME=elf32
EXTRA_EM_FILE=alphaelf
OUTPUT_FORMAT="elf64-alpha"
TEXT_START_ADDR="0x120000000"
-MAXPAGESIZE=0x10000
-COMMONPAGESIZE=0x2000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR="0x120000000"
ARCH=alpha
MACHINE=
diff --git a/ld/emulparams/elf64hppa.sh b/ld/emulparams/elf64hppa.sh
index 26c3153..b0a1fdc 100755
--- a/ld/emulparams/elf64hppa.sh
+++ b/ld/emulparams/elf64hppa.sh
@@ -4,7 +4,7 @@ LIB_PATH="=/usr/lib/pa20_64:=/opt/langtools/lib/pa20_64"
TEXT_START_ADDR=0x4000000000001000
DATA_ADDR=0x8000000000001000
TARGET_PAGE_SIZE=4096
-MAXPAGESIZE=4096
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
# The HP dynamic linker actually requires you set the start of text and
# data to some reasonable value. Of course nobody knows what reasoanble
diff --git a/ld/emulparams/elf64mmix.sh b/ld/emulparams/elf64mmix.sh
index 22b207f..7f867fb 100644
--- a/ld/emulparams/elf64mmix.sh
+++ b/ld/emulparams/elf64mmix.sh
@@ -12,11 +12,7 @@ TEXT_START_ADDR='DEFINED (__.MMIX.start..text) ? __.MMIX.start..text : 0'
TEXT_BASE_ADDRESS=$TEXT_START_ADDR
DATA_ADDR='DEFINED (__.MMIX.start..data) ? __.MMIX.start..data : 0x2000000000000000'
-# Setting this anywhere near the quite reasonable value of 0x10000
-# causes the binary to bloat to reach page alignment between segments.
-# Let's just have a 256-byte default page alignment. Having some
-# alignment at all gives a warm feeling but not much more.
-MAXPAGESIZE=256
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=mmix
MACHINE=
COMPILE_IN=yes
diff --git a/ld/emulparams/elf64ppc.sh b/ld/emulparams/elf64ppc.sh
index 8285723..75fd075 100644
--- a/ld/emulparams/elf64ppc.sh
+++ b/ld/emulparams/elf64ppc.sh
@@ -7,8 +7,8 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf64-powerpc"
TEXT_START_ADDR=0x10000000
#SEGMENT_SIZE=0x10000000
-MAXPAGESIZE=0x10000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH=powerpc:common64
MACHINE=
NOP=0x60000000
diff --git a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh
index af7010b..bdeaebb 100644
--- a/ld/emulparams/elf_i386.sh
+++ b/ld/emulparams/elf_i386.sh
@@ -1,8 +1,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x08048000
-MAXPAGESIZE=0x1000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
MACHINE=
diff --git a/ld/emulparams/elf_i386_be.sh b/ld/emulparams/elf_i386_be.sh
index 2c681b7..460707f 100644
--- a/ld/emulparams/elf_i386_be.sh
+++ b/ld/emulparams/elf_i386_be.sh
@@ -3,7 +3,7 @@ OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x80000000
#SHLIB_TEXT_START_ADDR=0x80000000
NONPAGED_TEXT_START_ADDR=0x80000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=i386
MACHINE=
NOP=0x90909090
diff --git a/ld/emulparams/elf_i386_chaos.sh b/ld/emulparams/elf_i386_chaos.sh
index e018231..a652913 100644
--- a/ld/emulparams/elf_i386_chaos.sh
+++ b/ld/emulparams/elf_i386_chaos.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf_chaos
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x40000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x40000000
ARCH=i386
MACHINE=
diff --git a/ld/emulparams/elf_i386_ldso.sh b/ld/emulparams/elf_i386_ldso.sh
index a477a69..d62184f 100644
--- a/ld/emulparams/elf_i386_ldso.sh
+++ b/ld/emulparams/elf_i386_ldso.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x08048000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
MACHINE=
diff --git a/ld/emulparams/elf_i386_vxworks.sh b/ld/emulparams/elf_i386_vxworks.sh
index 8bce8f7..cb36283 100644
--- a/ld/emulparams/elf_i386_vxworks.sh
+++ b/ld/emulparams/elf_i386_vxworks.sh
@@ -1,8 +1,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386-vxworks"
TEXT_START_ADDR=0x08048000
-MAXPAGESIZE=0x1000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
MACHINE=
diff --git a/ld/emulparams/elf_s390.sh b/ld/emulparams/elf_s390.sh
index 8d057dc..d958504 100644
--- a/ld/emulparams/elf_s390.sh
+++ b/ld/emulparams/elf_s390.sh
@@ -1,8 +1,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-s390"
TEXT_START_ADDR=0x00400000
-MAXPAGESIZE=0x1000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x00400000
ARCH="s390:31-bit"
MACHINE=
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index 9af2af5..f9ed236 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -2,8 +2,8 @@ SCRIPT_NAME=elf
ELFSIZE=64
OUTPUT_FORMAT="elf64-x86-64"
TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x200000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x400000
ARCH="i386:x86-64"
MACHINE=
diff --git a/ld/emulparams/hppa64linux.sh b/ld/emulparams/hppa64linux.sh
index aaf8c72..5ab4f4b 100644
--- a/ld/emulparams/hppa64linux.sh
+++ b/ld/emulparams/hppa64linux.sh
@@ -7,7 +7,7 @@ ELFSIZE=64
OUTPUT_FORMAT="elf64-hppa-linux"
TEXT_START_ADDR=0x10000
TARGET_PAGE_SIZE=0x10000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=hppa
MACHINE=hppa2.0w
ENTRY="main"
diff --git a/ld/emulparams/hppalinux.sh b/ld/emulparams/hppalinux.sh
index 89a253f..4c4f943 100644
--- a/ld/emulparams/hppalinux.sh
+++ b/ld/emulparams/hppalinux.sh
@@ -6,7 +6,7 @@ ELFSIZE=32
OUTPUT_FORMAT="elf32-hppa-linux"
TEXT_START_ADDR=0x10000
TARGET_PAGE_SIZE=0x10000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=hppa
MACHINE=hppa1.1 # We use 1.1 specific features.
NOP=0x08000240
diff --git a/ld/emulparams/hppaobsd.sh b/ld/emulparams/hppaobsd.sh
index 0227dc5..0d3bf94 100644
--- a/ld/emulparams/hppaobsd.sh
+++ b/ld/emulparams/hppaobsd.sh
@@ -3,4 +3,4 @@
OUTPUT_FORMAT="elf32-hppa"
TEXT_START_ADDR=0x1000
TARGET_PAGE_SIZE=0x1000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
diff --git a/ld/emulparams/i386lynx.sh b/ld/emulparams/i386lynx.sh
index 3235ebe..18e0860 100644
--- a/ld/emulparams/i386lynx.sh
+++ b/ld/emulparams/i386lynx.sh
@@ -4,7 +4,7 @@ ENTRY=_main
TEXT_BASE=0x0
DYN_TEXT_BASE=0x00400000
TEXT_START_ADDR="(DEFINED(_DYNAMIC) ? ${DYN_TEXT_BASE} : ${TEXT_BASE})"
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x1000
ARCH=i386
MACHINE=
diff --git a/ld/emulparams/i386moss.sh b/ld/emulparams/i386moss.sh
index eece447..659c7f2 100644
--- a/ld/emulparams/i386moss.sh
+++ b/ld/emulparams/i386moss.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x00002000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x00002000
ARCH=i386
MACHINE=
diff --git a/ld/emulparams/i386nto.sh b/ld/emulparams/i386nto.sh
index e4872ed..256d4c8 100644
--- a/ld/emulparams/i386nto.sh
+++ b/ld/emulparams/i386nto.sh
@@ -2,7 +2,7 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x08048000
TEXT_START_SYMBOLS='_btext = .;'
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x08048000
#SHLIB_TEXT_START_ADDR=0xb0300000
ARCH=i386
diff --git a/ld/emulparams/i386nw.sh b/ld/emulparams/i386nw.sh
index 621b475..dd5558c 100644
--- a/ld/emulparams/i386nw.sh
+++ b/ld/emulparams/i386nw.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=nw
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x08000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x08000000
ARCH=i386
NOP=0x90909090
diff --git a/ld/emulparams/m32relf_linux.sh b/ld/emulparams/m32relf_linux.sh
index be2ad23..9a4ee97 100644
--- a/ld/emulparams/m32relf_linux.sh
+++ b/ld/emulparams/m32relf_linux.sh
@@ -5,7 +5,7 @@ OUTPUT_FORMAT="elf32-m32r-linux"
TEXT_START_ADDR=0x1000
ARCH=m32r
MACHINE=
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
# Hmmm, there's got to be a better way. This sets the stack to the
# top of simulator memory (32MB).
diff --git a/ld/emulparams/m68kelf.sh b/ld/emulparams/m68kelf.sh
index b784a3c..4771f6b 100644
--- a/ld/emulparams/m68kelf.sh
+++ b/ld/emulparams/m68kelf.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-m68k"
TEXT_START_ADDR=0x80000000
-MAXPAGESIZE=0x2000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR}
ARCH=m68k
MACHINE=
diff --git a/ld/emulparams/m68kpsos.sh b/ld/emulparams/m68kpsos.sh
index 34eb8ca..22d1598 100644
--- a/ld/emulparams/m68kpsos.sh
+++ b/ld/emulparams/m68kpsos.sh
@@ -1,6 +1,6 @@
SCRIPT_NAME=psos
OUTPUT_FORMAT="elf32-m68k"
TEXT_START_ADDR=0x20000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=m68k
TEMPLATE_NAME=elf32
diff --git a/ld/emulparams/or32elf.sh b/ld/emulparams/or32elf.sh
index 04d1630..5f6b467 100644
--- a/ld/emulparams/or32elf.sh
+++ b/ld/emulparams/or32elf.sh
@@ -2,5 +2,5 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-or32"
TEXT_START_ADDR=0x1000000
TARGET_PAGE_SIZE=0x1000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=or32
diff --git a/ld/emulparams/pjelf.sh b/ld/emulparams/pjelf.sh
index acfd2b3..97eba8f 100644
--- a/ld/emulparams/pjelf.sh
+++ b/ld/emulparams/pjelf.sh
@@ -1,5 +1,5 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-pj"
TEXT_START_ADDR=0x1000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=pj
diff --git a/ld/emulparams/pjlelf.sh b/ld/emulparams/pjlelf.sh
index 35958fd..eb56810 100644
--- a/ld/emulparams/pjlelf.sh
+++ b/ld/emulparams/pjlelf.sh
@@ -1,5 +1,5 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-pjl"
TEXT_START_ADDR=0x1000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=pj
diff --git a/ld/emulparams/ppclynx.sh b/ld/emulparams/ppclynx.sh
index 2534687..5c5769e 100644
--- a/ld/emulparams/ppclynx.sh
+++ b/ld/emulparams/ppclynx.sh
@@ -3,7 +3,7 @@ OUTPUT_FORMAT="elf32-powerpc"
TEXT_BASE=0x00002000
DYN_TEXT_BASE=0x00400000
TEXT_START_ADDR="(DEFINED(_DYNAMIC) ? ${DYN_TEXT_BASE} : ${TEXT_BASE})"
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x1000
ARCH=powerpc
MACHINE=
diff --git a/ld/emulparams/ppcnw.sh b/ld/emulparams/ppcnw.sh
index c3ead43..14b2745 100644
--- a/ld/emulparams/ppcnw.sh
+++ b/ld/emulparams/ppcnw.sh
@@ -2,6 +2,6 @@ SCRIPT_NAME=nw
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
-MAXPAGESIZE=0x40000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
NONPAGED_TEXT_START_ADDR=0x0400000
ARCH=powerpc
diff --git a/ld/emulparams/shelf32_nbsd.sh b/ld/emulparams/shelf32_nbsd.sh
index 14965ef..63aee8f 100644
--- a/ld/emulparams/shelf32_nbsd.sh
+++ b/ld/emulparams/shelf32_nbsd.sh
@@ -5,7 +5,7 @@
OUTPUT_FORMAT="elf32-sh64-nbsd"
TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ENTRY=__start
diff --git a/ld/emulparams/shelf_nbsd.sh b/ld/emulparams/shelf_nbsd.sh
index 3fcd492..ad295e9 100644
--- a/ld/emulparams/shelf_nbsd.sh
+++ b/ld/emulparams/shelf_nbsd.sh
@@ -5,7 +5,7 @@
OUTPUT_FORMAT="elf32-sh-nbsd"
TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
DATA_START_SYMBOLS='__data_start = . ;';
diff --git a/ld/emulparams/shelf_nto.sh b/ld/emulparams/shelf_nto.sh
index f2252fb..70a0610 100644
--- a/ld/emulparams/shelf_nto.sh
+++ b/ld/emulparams/shelf_nto.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh"
TEXT_START_ADDR=0x08040000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=sh
MACHINE=
TEMPLATE_NAME=elf32
diff --git a/ld/emulparams/shlelf32_linux.sh b/ld/emulparams/shlelf32_linux.sh
index 59d4179..ba32e79 100644
--- a/ld/emulparams/shlelf32_linux.sh
+++ b/ld/emulparams/shlelf32_linux.sh
@@ -4,8 +4,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh64-linux"
TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH=sh
MACHINE=sh5
ALIGNMENT=8
diff --git a/ld/emulparams/shlelf_linux.sh b/ld/emulparams/shlelf_linux.sh
index 528b725..b06df26 100644
--- a/ld/emulparams/shlelf_linux.sh
+++ b/ld/emulparams/shlelf_linux.sh
@@ -4,8 +4,8 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh-linux"
TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
-COMMONPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH=sh
MACHINE=
TEMPLATE_NAME=elf32
diff --git a/ld/emulparams/shlelf_nto.sh b/ld/emulparams/shlelf_nto.sh
index d23e69a..c6c04f6 100644
--- a/ld/emulparams/shlelf_nto.sh
+++ b/ld/emulparams/shlelf_nto.sh
@@ -1,7 +1,7 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-shl"
TEXT_START_ADDR=0x08040000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=sh
MACHINE=
TEMPLATE_NAME=elf32
diff --git a/ld/emulparams/xtensa-config.sh b/ld/emulparams/xtensa-config.sh
index 5a5e504..82e96a4 100644
--- a/ld/emulparams/xtensa-config.sh
+++ b/ld/emulparams/xtensa-config.sh
@@ -1,3 +1,3 @@
# Xtensa configuration settings.
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index dffcff8..cafb6c5 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1846,6 +1846,22 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.relro = TRUE;
else if (strcmp (optarg, "norelro") == 0)
link_info.relro = FALSE;
+ else if (strncmp (optarg, "max-page-size=", 14) == 0)
+ {
+ char *end;
+ config.maxpagesize = strtoul (optarg + 14, &end, 0);
+ if (*end)
+ einfo (_("%P%F: invalid maxium page size \`%s'\n"),
+ optarg + 14);
+ }
+ else if (strncmp (optarg, "common-page-size=", 17) == 0)
+ {
+ char *end;
+ config.commonpagesize = strtoul (optarg + 17, &end, 0);
+ if (*end)
+ einfo (_("%P%F: invalid common page size \`%s'\n"),
+ optarg + 17);
+ }
/* What about the other Solaris -z options? FIXME. */
break;
EOF
@@ -1897,6 +1913,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n"));
fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n\t\t\t at runtime\n"));
fprintf (file, _(" -z relro\t\tCreate RELRO program header\n"));
+ fprintf (file, _(" -z max-page-size=SIZE\tSet maximum page size to SIZE\n"));
+ fprintf (file, _(" -z common-page-size=SIZE\n\t\t\tSet common page size to SIZE\n"));
fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n"));
EOF
fi
diff --git a/ld/ld.h b/ld/ld.h
index e1aa62c..174e5b9 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -270,6 +270,12 @@ typedef struct {
/* The size of the hash table to use. */
bfd_size_type hash_table_size;
+
+ /* The maximum page size for ELF. */
+ bfd_vma maxpagesize;
+
+ /* The common page size for ELF. */
+ bfd_vma commonpagesize;
} ld_config_type;
extern ld_config_type config;
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index fc2413e..182f060 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1007,6 +1007,12 @@ Marks the object may contain $ORIGIN.
@item relro
Create an ELF @code{PT_GNU_RELRO} segment header in the object.
+@item max-page-size=@var{value}
+Set the emulation maximum page size to @var{value}.
+
+@item common-page-size=@var{value}
+Set the emulation common page size to @var{value}.
+
@end table
Other keywords are ignored for Solaris compatibility.
diff --git a/ld/ldexp.c b/ld/ldexp.c
index c9d707e..b33329d 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -99,6 +99,7 @@ exp_print_token (token_code_type code, int infix_p)
{ SIZEOF, "SIZEOF" },
{ ADDR, "ADDR" },
{ LOADADDR, "LOADADDR" },
+ { CONSTANT, "CONSTANT" },
{ MAX_K, "MAX_K" },
{ REL, "relocatable" },
{ DATA_SEGMENT_ALIGN, "DATA_SEGMENT_ALIGN" },
@@ -623,6 +624,16 @@ fold_name (etree_type *tree)
}
break;
+ case CONSTANT:
+ if (strcmp (tree->name.name, "MAXPAGESIZE") == 0)
+ new_abs (bfd_emul_get_maxpagesize (default_target));
+ else if (strcmp (tree->name.name, "COMMONPAGESIZE") == 0)
+ new_abs (bfd_emul_get_commonpagesize (default_target));
+ else
+ einfo (_("%F%S: unknown constant `%s' referenced in expression\n"),
+ tree->name.name);
+ break;
+
default:
FAIL ();
break;
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 3829e6a..1f9d2fa 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -152,6 +152,7 @@ static int error_index;
%token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
%token KEEP ONLY_IF_RO ONLY_IF_RW SPECIAL
%token EXCLUDE_FILE
+%token CONSTANT
%type <versyms> vers_defns
%type <versnode> vers_tag
%type <deflist> verdep
@@ -841,6 +842,8 @@ exp :
{ $$ = exp_nameop (ADDR,$3); }
| LOADADDR '(' NAME ')'
{ $$ = exp_nameop (LOADADDR,$3); }
+ | CONSTANT '(' NAME ')'
+ { $$ = exp_nameop (CONSTANT,$3); }
| ABSOLUTE '(' exp ')'
{ $$ = exp_unop (ABSOLUTE, $3); }
| ALIGN_K '(' exp ')'
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 56ec391..10339dd 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -316,6 +316,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
<EXPRESSION,BOTH,SCRIPT>"PROVIDE_HIDDEN" { RTOKEN(PROVIDE_HIDDEN); }
<EXPRESSION,BOTH,SCRIPT>"KEEP" { RTOKEN(KEEP); }
<EXPRESSION,BOTH,SCRIPT>"EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); }
+<EXPRESSION,BOTH,SCRIPT>"CONSTANT" { RTOKEN(CONSTANT);}
<MRI>"#".*\n? { ++ lineno; }
<MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
<MRI>"*".* { /* Mri comment line */ }
diff --git a/ld/ldmain.c b/ld/ldmain.c
index db87a40..8881190 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -317,6 +317,9 @@ main (int argc, char **argv)
link_info.warn_shared_textrel = FALSE;
link_info.gc_sections = FALSE;
+ config.maxpagesize = 0;
+ config.commonpagesize = 0;
+
ldfile_add_arch ("");
config.make_executable = TRUE;
@@ -335,6 +338,13 @@ main (int argc, char **argv)
if (config.hash_table_size != 0)
bfd_hash_set_default_size (config.hash_table_size);
+ if (config.maxpagesize != 0)
+ bfd_emul_set_maxpagesize (default_target, config.maxpagesize);
+
+ if (config.commonpagesize != 0)
+ bfd_emul_set_commonpagesize (default_target,
+ config.commonpagesize);
+
ldemul_set_symbols ();
if (link_info.relocatable)
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index f2ea630..405a18a 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-elf/binutils.exp: New file.
+ * ld-elf/commonpage1.d: Likewise.
+ * ld-elf/maxpage1.d: Likewise.
+ * ld-elf/maxpage1.s: Likewise.
+
2006-05-25 H.J. Lu <hongjiu.lu@intel.com>
* ld-x86-64/tlsbin.dd: Updated for 2MB maximum page size.
diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp
new file mode 100644
index 0000000..77ba761
--- /dev/null
+++ b/ld/testsuite/ld-elf/binutils.exp
@@ -0,0 +1,80 @@
+# Expect script for binutils tests
+# Copyright 2006 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Written by H.J. Lu (hongjiu.lu@intel.com)
+#
+
+# Make sure that binutils can correctly handle ld output in ELF.
+
+# This test can only be run on ELF platforms.
+if ![is_elf_format] {
+ return
+}
+
+proc strip_test { ld_options test } {
+ global as
+ global ld
+ global READELF
+ global strip
+ global srcdir
+ global subdir
+
+ if { ![ld_assemble $as $srcdir/$subdir/$test.s tmpdir/$test.o ] } {
+ unresolved "$ld_options"
+ return
+ }
+
+ if { ![ld_simple_link $ld tmpdir/$test "$ld_options tmpdir/$test.o"] } {
+ unresolved "$ld_options"
+ return
+ }
+
+ send_log "$READELF -l --wide tmpdir/$test > tmpdir/$test.exp\n"
+ catch "exec $READELF -l --wide tmpdir/$test > tmpdir/$test.exp" got
+ if ![string match "" $got] then {
+ send_log "$got\n"
+ unresolved "$ld_options"
+ return
+ }
+
+ send_log "$strip tmpdir/$test\n"
+ catch "exec $strip tmpdir/$test" got
+ if ![string match "" $got] then {
+ send_log "$got\n"
+ unresolved "$ld_options"
+ return
+ }
+
+ send_log "$READELF -l --wide tmpdir/$test > tmpdir/$test.out\n"
+ catch "exec $READELF -l --wide tmpdir/$test > tmpdir/$test.out" got
+ if ![string match "" $got] then {
+ send_log "$got\n"
+ unresolved "$ld_options"
+ return
+ }
+
+ if { [catch {exec cmp tmpdir/$test.exp tmpdir/$test.out}] } then {
+ send_log "tmpdir/$test.exp tmpdir/$test.out differ.\n"
+ fail "$ld_options"
+ return
+ }
+
+ pass "$ld_options"
+}
+
+strip_test "-z max-page-size=0x200000" maxpage1
+strip_test "-z max-page-size=0x200000 -z common-page-size=0x100000" maxpage1
diff --git a/ld/testsuite/ld-elf/commonpage1.d b/ld/testsuite/ld-elf/commonpage1.d
new file mode 100644
index 0000000..5b685b2
--- /dev/null
+++ b/ld/testsuite/ld-elf/commonpage1.d
@@ -0,0 +1,8 @@
+#source: maxpage1.s
+#ld: -z max-page-size=0x200000 -z common-page-size=0x100000
+#readelf: -l --wide
+
+#...
+ LOAD+.*0x200000
+ LOAD+.*0x200000
+#pass
diff --git a/ld/testsuite/ld-elf/maxpage1.d b/ld/testsuite/ld-elf/maxpage1.d
new file mode 100644
index 0000000..f7f2dbf
--- /dev/null
+++ b/ld/testsuite/ld-elf/maxpage1.d
@@ -0,0 +1,8 @@
+#source: maxpage1.s
+#ld: -z max-page-size=0x200000
+#readelf: -l --wide
+
+#...
+ LOAD+.*0x200000
+ LOAD+.*0x200000
+#pass
diff --git a/ld/testsuite/ld-elf/maxpage1.s b/ld/testsuite/ld-elf/maxpage1.s
new file mode 100644
index 0000000..b64ee3a
--- /dev/null
+++ b/ld/testsuite/ld-elf/maxpage1.s
@@ -0,0 +1,7 @@
+ .text
+ .global _start
+_start:
+ .long 0
+
+ .data
+ .long 0