]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 30 May 2006 16:45:32 +0000 (16:45 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 30 May 2006 16:45:32 +0000 (16:45 +0000)
2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>

* bfd.c (bfd_emul_get_maxpagesize): New.
(bfd_elf_set_pagesize): Likewise.
(bfd_emul_set_maxpagesize): Likewise.
(bfd_emul_get_commonpagesize): Likewise.
(bfd_emul_set_commonpagesize): Likewise.
* bfd-in2.h: Regenerated.

* elf-bfd.h (elf_backend_data): Add commonpagesize.
(xvec_get_elf_backend_data): New.
(get_elf_backend_data): Use xvec_get_elf_backend_data.

* elf32-arm.c (elf32_arm_vxworks_bed): Remove const.
* elfxx-target.h (elfNN_bed): Likewise.

* elf32-arm.c (ELF_COMMONPAGESIZE): Defined.
* elf32-mips.c (ELF_COMMONPAGESIZE): Likewise.
* elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise.
* elf32-sh.c (ELF_COMMONPAGESIZE): Likewise.
* elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise.
* elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise.
* elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise.
* elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
* elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise.
* elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise.
* elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise.
* elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise.

* elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined.
(elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE.

* targets.c (bfd_find_target): Support NULL abfd.

ld/

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.
ld/testsuite/

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.

97 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/bfd.c
bfd/elf-bfd.h
bfd/elf32-arm.c
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf32-sh.c
bfd/elf32-sh64.c
bfd/elf32-sparc.c
bfd/elf64-alpha.c
bfd/elf64-ppc.c
bfd/elf64-sparc.c
bfd/elf64-x86-64.c
bfd/elfn32-mips.c
bfd/elfxx-ia64.c
bfd/elfxx-target.h
bfd/targets.c
ld/ChangeLog
ld/emulparams/arcelf.sh
ld/emulparams/armelf_linux.sh
ld/emulparams/armelf_nbsd.sh
ld/emulparams/armelf_vxworks.sh
ld/emulparams/armnto.sh
ld/emulparams/armsymbian.sh
ld/emulparams/bfin.sh
ld/emulparams/crislinux.sh
ld/emulparams/elf32_i860.sh
ld/emulparams/elf32_i960.sh
ld/emulparams/elf32_sparc.sh
ld/emulparams/elf32am33lin.sh
ld/emulparams/elf32bfinfd.sh
ld/emulparams/elf32bmip.sh
ld/emulparams/elf32bmipn32-defs.sh
ld/emulparams/elf32bmipn32.sh
ld/emulparams/elf32btsmipn32.sh
ld/emulparams/elf32frvfd.sh
ld/emulparams/elf32i370.sh
ld/emulparams/elf32lppcnto.sh
ld/emulparams/elf32mcore.sh
ld/emulparams/elf32openrisc.sh
ld/emulparams/elf32ppccommon.sh
ld/emulparams/elf32ppcnto.sh
ld/emulparams/elf32ppcwindiss.sh
ld/emulparams/elf32vax.sh
ld/emulparams/elf32xc16x.sh
ld/emulparams/elf32xc16xl.sh
ld/emulparams/elf32xc16xs.sh
ld/emulparams/elf64_aix.sh
ld/emulparams/elf64_ia64.sh
ld/emulparams/elf64_s390.sh
ld/emulparams/elf64_sparc.sh
ld/emulparams/elf64alpha.sh
ld/emulparams/elf64hppa.sh
ld/emulparams/elf64mmix.sh
ld/emulparams/elf64ppc.sh
ld/emulparams/elf_i386.sh
ld/emulparams/elf_i386_be.sh
ld/emulparams/elf_i386_chaos.sh
ld/emulparams/elf_i386_ldso.sh
ld/emulparams/elf_i386_vxworks.sh
ld/emulparams/elf_s390.sh
ld/emulparams/elf_x86_64.sh
ld/emulparams/hppa64linux.sh
ld/emulparams/hppalinux.sh
ld/emulparams/hppaobsd.sh
ld/emulparams/i386lynx.sh
ld/emulparams/i386moss.sh
ld/emulparams/i386nto.sh
ld/emulparams/i386nw.sh
ld/emulparams/m32relf_linux.sh
ld/emulparams/m68kelf.sh
ld/emulparams/m68kpsos.sh
ld/emulparams/or32elf.sh
ld/emulparams/pjelf.sh
ld/emulparams/pjlelf.sh
ld/emulparams/ppclynx.sh
ld/emulparams/ppcnw.sh
ld/emulparams/shelf32_nbsd.sh
ld/emulparams/shelf_nbsd.sh
ld/emulparams/shelf_nto.sh
ld/emulparams/shlelf32_linux.sh
ld/emulparams/shlelf_linux.sh
ld/emulparams/shlelf_nto.sh
ld/emulparams/xtensa-config.sh
ld/emultempl/elf32.em
ld/ld.h
ld/ld.texinfo
ld/ldexp.c
ld/ldgram.y
ld/ldlex.l
ld/ldmain.c
ld/testsuite/ChangeLog
ld/testsuite/ld-elf/binutils.exp [new file with mode: 0644]
ld/testsuite/ld-elf/commonpage1.d [new file with mode: 0644]
ld/testsuite/ld-elf/maxpage1.d [new file with mode: 0644]
ld/testsuite/ld-elf/maxpage1.s [new file with mode: 0644]

index 65de90e5cc9b20df5e4eba34e354f9c80ebdeabe..075bbc3a90046af1363e2bb350839c4bf8689594 100644 (file)
@@ -1,3 +1,37 @@
+2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * bfd.c (bfd_emul_get_maxpagesize): New.
+       (bfd_elf_set_pagesize): Likewise.
+       (bfd_emul_set_maxpagesize): Likewise.
+       (bfd_emul_get_commonpagesize): Likewise.
+       (bfd_emul_set_commonpagesize): Likewise.
+       * bfd-in2.h: Regenerated.
+
+       * elf-bfd.h (elf_backend_data): Add commonpagesize.
+       (xvec_get_elf_backend_data): New.
+       (get_elf_backend_data): Use xvec_get_elf_backend_data.
+
+       * elf32-arm.c (elf32_arm_vxworks_bed): Remove const.
+       * elfxx-target.h (elfNN_bed): Likewise.
+
+       * elf32-arm.c (ELF_COMMONPAGESIZE): Defined.
+       * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise.
+       * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise.
+       * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise.
+       * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise.
+
+       * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined.
+       (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE.
+
+       * targets.c (bfd_find_target): Support NULL abfd.
+
 2006-05-30  Nick Clifton  <nickc@redhat.com>
 
        * po/es.po: Updated Spanish translation.
index cdbeb583de8291bd97c260519d973d263f2d77a0..b896a6b9b00b5a5b246585b0b9d1bd85fbcc7f19 100644 (file)
@@ -4709,6 +4709,14 @@ void bfd_preserve_restore (bfd *, struct bfd_preserve *);
 
 void bfd_preserve_finish (bfd *, struct bfd_preserve *);
 
+bfd_vma bfd_emul_get_maxpagesize (const char *);
+
+void bfd_emul_set_maxpagesize (const char *, bfd_vma);
+
+bfd_vma bfd_emul_get_commonpagesize (const char *);
+
+void bfd_emul_set_commonpagesize (const char *, bfd_vma);
+
 /* Extracted from archive.c.  */
 symindex bfd_get_next_mapent
    (bfd *abfd, symindex previous, carsym **sym);
index 733f6ee0272db1beb8b385505719f27f45929391..ebfd3146eb5de0c0ca3b7cd8c2094052b64b08b6 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1513,3 +1513,130 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve)
      objalloc.  */
   bfd_hash_table_free (&preserve->section_htab);
 }
+
+/*
+FUNCTION
+       bfd_emul_get_maxpagesize
+
+SYNOPSIS
+       bfd_vma bfd_emul_get_maxpagesize (const char *);
+
+DESCRIPTION
+       Returns the maximum page size, in bytes, as determined by
+       emulation.
+
+RETURNS
+       Returns the maximum page size in bytes for ELF, abort
+       otherwise.
+*/
+
+bfd_vma
+bfd_emul_get_maxpagesize (const char *emul)
+{
+  const bfd_target *target;
+
+  target = bfd_find_target (emul, NULL);
+  if (target != NULL
+      && target->flavour == bfd_target_elf_flavour)
+    return xvec_get_elf_backend_data (target)->maxpagesize;
+
+  abort ();
+  return 0;
+}
+
+static void
+bfd_elf_set_pagesize (const bfd_target *target, bfd_vma size,
+                     int offset, const bfd_target *orig_target)
+{
+  if (target->flavour == bfd_target_elf_flavour)
+    {
+      const struct elf_backend_data *bed;
+
+      bed = xvec_get_elf_backend_data (target);
+      *((bfd_vma *) ((char *) bed + offset)) = size;
+    }
+
+  if (target->alternative_target
+      && target->alternative_target != orig_target)
+    bfd_elf_set_pagesize (target->alternative_target, size, offset,
+                         orig_target);
+}
+
+/*
+FUNCTION
+       bfd_emul_set_maxpagesize
+
+SYNOPSIS
+       void bfd_emul_set_maxpagesize (const char *, bfd_vma);
+
+DESCRIPTION
+       For ELF, set the maximum page size for the emulation.  It is
+       a no-op for other formats.
+
+*/
+
+void
+bfd_emul_set_maxpagesize (const char *emul, bfd_vma size)
+{
+  const bfd_target *target;
+
+  target = bfd_find_target (emul, NULL);
+  if (target)
+    bfd_elf_set_pagesize (target, size,
+                         offsetof (struct elf_backend_data,
+                                   maxpagesize), target);
+}
+
+/*
+FUNCTION
+       bfd_emul_get_commonpagesize
+
+SYNOPSIS
+       bfd_vma bfd_emul_get_commonpagesize (const char *);
+
+DESCRIPTION
+       Returns the common page size, in bytes, as determined by
+       emulation.
+
+RETURNS
+       Returns the common page size in bytes for ELF, abort otherwise.
+*/
+
+bfd_vma
+bfd_emul_get_commonpagesize (const char *emul)
+{
+  const bfd_target *target;
+
+  target = bfd_find_target (emul, NULL);
+  if (target != NULL
+      && target->flavour == bfd_target_elf_flavour)
+    return xvec_get_elf_backend_data (target)->commonpagesize;
+
+  abort ();
+  return 0;
+}
+
+/*
+FUNCTION
+       bfd_emul_set_commonpagesize
+
+SYNOPSIS
+       void bfd_emul_set_commonpagesize (const char *, bfd_vma);
+
+DESCRIPTION
+       For ELF, set the common page size for the emulation.  It is
+       a no-op for other formats.
+
+*/
+
+void
+bfd_emul_set_commonpagesize (const char *emul, bfd_vma size)
+{
+  const bfd_target *target;
+
+  target = bfd_find_target (emul, NULL);
+  if (target)
+    bfd_elf_set_pagesize (target, size,
+                         offsetof (struct elf_backend_data,
+                                   commonpagesize), target);
+}
index 3a32fc447d00db9e09ce5d8093c6c4c5cb5bd682..89baa9c463ecb1694d991374b523778bacfe7d43 100644 (file)
@@ -571,6 +571,9 @@ struct elf_backend_data
      pages at least this large.  May be smaller than maxpagesize.  */
   bfd_vma minpagesize;
 
+  /* The common page size for this backend.  */
+  bfd_vma commonpagesize;
+
   /* The BFD flags applied to sections created for dynamic linking.  */
   flagword dynamic_sec_flags;
 
@@ -1196,8 +1199,11 @@ struct bfd_elf_section_data
    && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE              \
    && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
 
+#define xvec_get_elf_backend_data(xvec) \
+  ((struct elf_backend_data *) (xvec)->backend_data)
+
 #define get_elf_backend_data(abfd) \
-  ((const struct elf_backend_data *) (abfd)->xvec->backend_data)
+   xvec_get_elf_backend_data ((abfd)->xvec)
 
 /* This struct is used to pass information to routines called via
    elf_link_hash_traverse which must return failure.  */
index e2beac74047169eb00064cbf9679988270229a07..ae8ef8f70ac1b8f9245bdf9b13c053d42199f029 100644 (file)
@@ -62,7 +62,7 @@
 #define ARM_ELF_ABI_VERSION            0
 #define ARM_ELF_OS_ABI_VERSION         ELFOSABI_ARM
 
-static const struct elf_backend_data elf32_arm_vxworks_bed;
+static struct elf_backend_data elf32_arm_vxworks_bed;
 
 /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
    R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO
@@ -8406,6 +8406,7 @@ const struct elf_size_info elf32_arm_size_info = {
 #define ELF_MAXPAGESIZE                        0x8000
 #endif
 #define ELF_MINPAGESIZE                        0x1000
+#define ELF_COMMONPAGESIZE             0x1000
 
 #define bfd_elf32_mkobject                     elf32_arm_mkobject
 
index 6ed4ad35f6271a24466110c9121ff2dc8d5349f9..fd8a4277123bf9e10a671de2b24f65c88152fe20 100644 (file)
@@ -1599,6 +1599,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 /* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses
    a value of 0x1000, and we are compatible.  */
 #define ELF_MAXPAGESIZE                        0x1000
+#define ELF_COMMONPAGESIZE             0x1000
 
 #include "elf32-target.h"
 
index 9be70f82ce760ed2a7239c1cef80307c15c8d61e..b1d18e7c236578b88b3b35e3821e71687a7d1724 100644 (file)
@@ -7436,6 +7436,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
 #define ELF_MAXPAGESIZE                0x10000
 #endif
 #define ELF_MINPAGESIZE                0x1000
+#define ELF_COMMONPAGESIZE     0x1000
 #define elf_info_to_howto      ppc_elf_info_to_howto
 
 #ifdef  EM_CYGNUS_POWERPC
index 118690d9a58fd31deeadaad41d52495898e43ea9..cf59095ed4773ccf70452bf9f3ae13c2de9732e2 100644 (file)
@@ -7371,6 +7371,7 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt,
 #define        TARGET_LITTLE_NAME              "elf32-shl-nbsd"
 #undef ELF_MAXPAGESIZE
 #define        ELF_MAXPAGESIZE                 0x10000
+#undef ELF_COMMONPAGESIZE
 #undef elf_symbol_leading_char
 #define        elf_symbol_leading_char         0
 #undef elf32_bed
@@ -7388,6 +7389,8 @@ sh_elf_plt_sym_val (bfd_vma i, const asection *plt,
 #define        TARGET_LITTLE_SYM               bfd_elf32_shlin_vec
 #undef TARGET_LITTLE_NAME
 #define        TARGET_LITTLE_NAME              "elf32-sh-linux"
+#undef ELF_COMMONPAGESIZE
+#define        ELF_COMMONPAGESIZE              0x1000
 
 #undef elf_backend_grok_prstatus
 #define        elf_backend_grok_prstatus       elf32_shlin_grok_prstatus
index 219f7533f154d964c42e32d33c4c1f008d8bba0c..55aa25b7de9082acf32f7d5ec44b62f4d6649ca7 100644 (file)
@@ -785,6 +785,7 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] =
 #define        TARGET_LITTLE_NAME      "elf32-sh64l-nbsd"
 #undef ELF_MAXPAGESIZE
 #define        ELF_MAXPAGESIZE         0x10000
+#undef ELF_COMMONPAGESIZE
 #undef elf_symbol_leading_char
 #define        elf_symbol_leading_char 0
 #undef elf32_bed
@@ -803,6 +804,8 @@ static const struct bfd_elf_special_section sh64_elf_special_sections[] =
 #define        TARGET_LITTLE_NAME      "elf32-sh64-linux"
 #undef elf32_bed
 #define        elf32_bed               elf32_sh64_lin_bed
+#undef ELF_COMMONPAGESIZE
+#define        ELF_COMMONPAGESIZE      0x1000
 
 #include "elf32-target.h"
 
index 3bfb38a3d44ac8482b86d1afb840d6b4b9749f97..3f0c7d6c6d9ab82a4ca1977f1893addb8aed9e63 100644 (file)
@@ -172,6 +172,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
 #define ELF_MACHINE_CODE EM_SPARC
 #define ELF_MACHINE_ALT1 EM_SPARC32PLUS
 #define ELF_MAXPAGESIZE 0x10000
+#define ELF_COMMONPAGESIZE 0x2000
 
 #define bfd_elf32_bfd_merge_private_bfd_data \
                                        elf32_sparc_merge_private_bfd_data
index 76d0661a11657055261af2a583636279f8eede74..625d8341856aeebbcff6923bc84e39b37b4c46c6 100644 (file)
@@ -5231,6 +5231,7 @@ static const struct elf_size_info alpha_elf_size_info =
 #define ELF_ARCH               bfd_arch_alpha
 #define ELF_MACHINE_CODE       EM_ALPHA
 #define ELF_MAXPAGESIZE        0x10000
+#define ELF_COMMONPAGESIZE     0x2000
 
 #define bfd_elf64_bfd_link_hash_table_create \
   elf64_alpha_bfd_link_hash_table_create
index b1ec94230a5c089a02873b69800c9145aa71bb4d..2c29b571b29b9c0724d6fb5e78679888a7716b4e 100644 (file)
@@ -61,6 +61,7 @@ static bfd_vma opd_entry_value
 #define ELF_ARCH               bfd_arch_powerpc
 #define ELF_MACHINE_CODE       EM_PPC64
 #define ELF_MAXPAGESIZE                0x10000
+#define ELF_COMMONPAGESIZE     0x1000
 #define elf_info_to_howto      ppc64_elf_info_to_howto
 
 #define elf_backend_want_got_sym 0
index dd1c302174af234aa01a94bb5cb9856ab62f1325..5c928e232a76a99b93ec93b4854c86c8c765ac0c 100644 (file)
@@ -814,6 +814,7 @@ const struct elf_size_info elf64_sparc_size_info =
 #define TARGET_BIG_NAME        "elf64-sparc"
 #define ELF_ARCH       bfd_arch_sparc
 #define ELF_MAXPAGESIZE 0x100000
+#define ELF_COMMONPAGESIZE 0x2000
 
 /* This is the official ABI value.  */
 #define ELF_MACHINE_CODE EM_SPARCV9
index 7799a43f070d8cabab147831bc2a7194b8ed9f02..42569b78aa6a8a86e8173e26e778d401a8df0c44 100644 (file)
@@ -3632,6 +3632,7 @@ static const struct bfd_elf_special_section
 #define ELF_MACHINE_CODE                   EM_X86_64
 #define ELF_MAXPAGESIZE                            0x200000
 #define ELF_MINPAGESIZE                            0x1000
+#define ELF_COMMONPAGESIZE                 0x1000
 
 #define elf_backend_can_gc_sections        1
 #define elf_backend_can_refcount           1
index b1211f0c65e56de8e2ccfcc2b05fd63ce718aa27..8e7eb53c319710909c6730c3878b36acc2759a17 100644 (file)
@@ -2384,6 +2384,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
    a value of 0x1000, and we are compatible.
    FIXME: How does this affect NewABI?  */
 #define ELF_MAXPAGESIZE                        0x1000
+#define ELF_COMMONPAGESIZE             0x1000
 
 #include "elf32-target.h"
 
index 953a7767d1676469a0a36ba64796618e6db3594b..817ccb14390fa19a2e417985de424cde32c75331 100644 (file)
@@ -5717,6 +5717,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
 #define ELF_MACHINE_ALT1               1999    /* EAS2.3 */
 #define ELF_MACHINE_ALT2               1998    /* EAS2.2 */
 #define ELF_MAXPAGESIZE                        0x10000 /* 64KB */
+#define ELF_COMMONPAGESIZE             0x4000  /* 16KB */
 
 #define elf_backend_section_from_shdr \
        elfNN_ia64_section_from_shdr
@@ -5824,6 +5825,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
 
 #undef  ELF_MAXPAGESIZE
 #define ELF_MAXPAGESIZE                 0x1000  /* 4K */
+#undef ELF_COMMONPAGESIZE
 
 #undef  elfNN_bed
 #define elfNN_bed elfNN_ia64_hpux_bed
index 5a5ca348996c6308c68e25c5ec11f80eeb989327..fad00f2a0f58960a172cafb878f8f9e1bebd2b99 100644 (file)
 #define ELF_MINPAGESIZE ELF_MAXPAGESIZE
 #endif
 
+#ifndef ELF_COMMONPAGESIZE
+#define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
+#endif
+
 #ifndef ELF_DYNAMIC_SEC_FLAGS
 /* Note that we set the SEC_IN_MEMORY flag for these sections.  */
 #define ELF_DYNAMIC_SEC_FLAGS                  \
 extern const struct elf_size_info _bfd_elfNN_size_info;
 
 #ifndef INCLUDED_TARGET_FILE
-static const struct elf_backend_data elfNN_bed =
+static struct elf_backend_data elfNN_bed =
 {
   ELF_ARCH,                    /* arch */
   ELF_MACHINE_CODE,            /* elf_machine_code */
   ELF_MAXPAGESIZE,             /* maxpagesize */
   ELF_MINPAGESIZE,             /* minpagesize */
+  ELF_COMMONPAGESIZE,          /* commonpagesize */
   ELF_DYNAMIC_SEC_FLAGS,       /* dynamic_sec_flags */
   elf_info_to_howto,
   elf_info_to_howto_rel,
index 849eb944fbeb74e6142fd794ac5b60b624d30de5..09e4bc0b39860ce89aed92feaded8038d66550aa 100644 (file)
@@ -1307,14 +1307,15 @@ SYNOPSIS
 
 DESCRIPTION
        Return a pointer to the transfer vector for the object target
-       named @var{target_name}.  If @var{target_name} is <<NULL>>, choose the
-       one in the environment variable <<GNUTARGET>>; if that is null or not
-       defined, then choose the first entry in the target list.
-       Passing in the string "default" or setting the environment
-       variable to "default" will cause the first entry in the target
-       list to be returned, and "target_defaulted" will be set in the
-       BFD.  This causes <<bfd_check_format>> to loop over all the
-       targets to find the one that matches the file being read.
+       named @var{target_name}.  If @var{target_name} is <<NULL>>,
+       choose the one in the environment variable <<GNUTARGET>>; if
+       that is null or not defined, then choose the first entry in the
+       target list.  Passing in the string "default" or setting the
+       environment variable to "default" will cause the first entry in
+       the target list to be returned, and "target_defaulted" will be
+       set in the BFD if @var{abfd} isn't <<NULL>>.  This causes
+       <<bfd_check_format>> to loop over all the targets to find the
+       one that matches the file being read.
 */
 
 const bfd_target *
@@ -1331,21 +1332,27 @@ bfd_find_target (const char *target_name, bfd *abfd)
   /* This is safe; the vector cannot be null.  */
   if (targname == NULL || strcmp (targname, "default") == 0)
     {
-      abfd->target_defaulted = TRUE;
       if (bfd_default_vector[0] != NULL)
-       abfd->xvec = bfd_default_vector[0];
+       target = bfd_default_vector[0];
       else
-       abfd->xvec = bfd_target_vector[0];
-      return abfd->xvec;
+       target = bfd_target_vector[0];
+      if (abfd)
+       {
+         abfd->xvec = target;
+         abfd->target_defaulted = TRUE;
+       }
+      return target;
     }
 
-  abfd->target_defaulted = FALSE;
+  if (abfd)
+    abfd->target_defaulted = FALSE;
 
   target = find_target (targname);
   if (target == NULL)
     return NULL;
 
-  abfd->xvec = target;
+  if (abfd)
+    abfd->xvec = target;
   return target;
 }
 
index 42d6864e9ad66914136d5543a6d04086eb3b63fd..0c75415625d1894a16fdba5b2583544e72b284cf 100644 (file)
@@ -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.
index b1c9c1760cee1b5f76b03b9465ee929228229367..f023093e30c3c76128cb7b03717aeee09c2f2eea 100644 (file)
@@ -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=
index 39b7f656409f2a87d374e77975d7871d11ce34c1..e7c8025d9a2021b79164c5deb716249ca0bf8cda 100644 (file)
@@ -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
index 3d94839153568a564c69f4ee98736e2e130d498e..517cd626594cce59da3cf86ef5ca3eb500a8b60b 100644 (file)
@@ -1,5 +1,5 @@
 . ${srcdir}/emulparams/armelf.sh
-MAXPAGESIZE=0x8000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 TEXT_START_ADDR=0x00008000
 TARGET2_TYPE=got-rel
 
index 7b6445e8308288acdf573c941d90141f9423eecc..ca5c907a07b1e8c400d1f51347d20fbf7ac55458 100644 (file)
@@ -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
index 64296129dc2cb7744f4b5beff07cf7768954c2eb..6891e63432f52e45e08b2bc9f6b465a71b14f79b 100644 (file)
@@ -17,7 +17,7 @@ GENERATE_SHLIB_SCRIPT=yes
 
 ARCH=arm
 MACHINE=
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 
 ENTRY=_start
 
index a52d05b248069371c3050559d8e12babc1157a9d..3d7e86495974485633f13f0970c0f721a839d7e6 100644 (file)
@@ -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)"
index 5e7adda4dd9b753c7b6b92827470e9cee57f751c..b7695a4c8b92773177304dfc4289685a6b2e3b64 100755 (executable)
@@ -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
index 98d12f3929b84a903b3bfb53131923cb82c5015e..e41024c9a7afb49cbbf0c9af6f3ab0b6989da515 100644 (file)
@@ -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
index 6769fa54d262362fd5efe4cfaead0521efa383f6..1ab42043313feead95940988f2b86aee468b852e 100644 (file)
@@ -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
index 10ec3fa573b742cf5420d3942f3ebbbf9dd0218b..1ef729297ab18d4228f56fb2919e3afeed673542 100644 (file)
@@ -5,4 +5,4 @@ ARCH=i960
 MACHINE=
 TEXT_START_ADDR=0
 EMBEDDED=yes
-MAXPAGESIZE=0x2000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
index af23252949ff7097ba2c8ab14d30dd9cd7a9296b..1d31d22282fbe9c06d179c174d0c70fbd48b7807 100644 (file)
@@ -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
index f8b3a8906217331e75cd5ead5e97f7d23446d4a4..31dbc70b882d8c8ea844e7aa94d24c45b89fe6ef 100644 (file)
@@ -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=
index 9047c6a750f03c357eab5b235d97caf2ef6e44c1..19ec748b7fb983ba675bf981b76c011e8c42a3ac 100644 (file)
@@ -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
index 5da30490bdec7f049d79fbd3904b125f1908cd37..7260be0ecf266d4ca1d1148ed4aa092c47fb1324 100644 (file)
@@ -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=
index b81ac49ec305002312da248d40fe6cbe863ba81b..8f56ccf4fbe41085e24b4971ea2a2677d3642b55 100644 (file)
@@ -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.  
index a320eb23ed07dc117c5a93871a69fe9f05506459..c26b6b3dcb2ea4369839a83b223f7ab0e99c72a6 100755 (executable)
@@ -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="
index 5ca6797e52a98a133c41095b4d9bf5300f9c306a..10c5565cc43270761c465ac6bb9c0686157ef116 100644 (file)
@@ -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.*)'
index 42b36f7d63d65c584dd4afb804dfea0e03502920..7029d4716382619b8395f31d07139366be1d4dcc 100644 (file)
@@ -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
index d9d5d85617a93d88f11dda1fd40bd1487b78ac75..425238c2afccc28ed8bc0a54f25d547f1841fba2 100644 (file)
@@ -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=
index 1f1905542b23831bfaf8def4966f921a441b7cbc..c45260d0236e8fad91eaa45c3ef4d60863c815d0 100644 (file)
@@ -1,5 +1,5 @@
 . ${srcdir}/emulparams/elf32ppc.sh
 OUTPUT_FORMAT="elf32-powerpcle"
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 TEXT_START_ADDR=0x48040000
 
index 930a9c3c8bcdeccb03325f4f57f4d31ed8fbdaad..6d9f2d6a992c2e5af32776ef3bfd64f95a82d73f 100644 (file)
@@ -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
index a65dcd89c57ed6f79a176bf76476897ef296b714..53e88ddf86ad878f88caaaaca556f40db50570b6 100755 (executable)
@@ -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
index b5fbc8d8e8989e4c709e82a13cca5ee3d81433a0..1a12890b06396f6a8750564cf264c6dd7f37cea5 100644 (file)
@@ -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);'
index dd4a79cb91a8ded88ebea1fd719a27f4f024ecf9..d0b3e3dfb60f6aa63d0509c093411b936ddbcea5 100644 (file)
@@ -1,4 +1,4 @@
 . ${srcdir}/emulparams/elf32ppc.sh
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 TEXT_START_ADDR=0x48040000
 
index c0e6138c29f7f34d437c45d0102c653a22c75a23..d217de94007c78ceb4f6144aab00901659b4c2b9 100644 (file)
@@ -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.
index 56bbab7deb38de24804b9142b2575bdd9787e71f..42e846f22e2bf6068d05fabe566cfd385dc1d5d2 100644 (file)
@@ -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=
index 808feeddc47afc7a57c265cbe2cafb1828da6d85..f88ccee8177ae9c72ffb468023d05f315f003ed4 100644 (file)
@@ -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
index 333f2a6fd78ade327f07538f2432d23f86f6499e..14eb24bec81b806d70427a14c70ee8b538cae62f 100644 (file)
@@ -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
index df36f41097715b38dd75c49fc6ce20f4f5afd2b4..2454963a970ba1e277832d9aa2e6305281c86b52 100644 (file)
@@ -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
index 738fea94ff03830bc664d9cd78bf6d183ee53a8f..39325f577201d65c4d3c44dcc6120465e9b946f0 100644 (file)
@@ -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
index c5be56e8508f14e788aa8e926054ecc74558e180..7e5e54d391ed8ce0fc03a07e50eff2f683a42257 100644 (file)
@@ -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))"
index ea75d319838b4a43f90778479c3d2721a74cd137..a26bbb63e0deabafd1261bcdc31557d176689c7e 100644 (file)
@@ -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=
index 0c0f5d89e3d3cdf6edb5d2655df14007b5267b84..cef4bff96e1b0d600dfb43d2b9a9cab51eebaa89 100644 (file)
@@ -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=
index 47a0bb009c77a3aa10ea761cbfefb9edc03e06c6..2c3b7d4dd2b6fc96f8857400d0fc3c34caf057bc 100644 (file)
@@ -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=
index 26c3153f069b3b91d9c1a5e90009679536e4a306..b0a1fdc5008ae1ea04ec30e92bb8f4fcdf05a604 100755 (executable)
@@ -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
index 22b207fce16484b7f668c87acdf1ca1fffa6e0e2..7f867fb8cff4f7df927e36abba542bbd7376c78e 100644 (file)
@@ -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
index 8285723fba01ee032bdd22b30de21143aa4afa25..75fd075e91046cc3802504009f3a275961bffc54 100644 (file)
@@ -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
index af7010b6836e3d876b0223671a14933c9d7ad1ea..bdeaebb30849474e87e59c2d25cc56aaa95c033a 100644 (file)
@@ -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=
index 2c681b763afd449fdcfbbec4c22f647a4bbada31..460707fc484a90aeb5d79d62edea84469c107ca3 100644 (file)
@@ -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
index e018231f043e8980539142a4b14dfaefda4ff1d7..a652913f86e5a378ae84965d2efbfc8b2533ba4a 100644 (file)
@@ -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=
index a477a6932863c5d587490e6c2ed60cf74ef4b555..d62184fc9c2927957c79947944e1f6da780a2528 100644 (file)
@@ -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=
index 8bce8f722c0b63ef4162e9602ecf084cea4803df..cb36283da4f6c923a885e206bf4ec77af59d7aa6 100644 (file)
@@ -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=
index 8d057dc3df14e6bdc38508ae32009bcb1922a2ff..d958504a8345feb6322d1b36de6b21e2ce34bede 100644 (file)
@@ -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=
index 9af2af503fc4caf5a90215e2a636bc14e8fb54b7..f9ed236ad4bb2a04c7596d3cef4e950cbc70ab63 100644 (file)
@@ -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=
index aaf8c7251f5a56dc7802e9be4571fa1e938f4b70..5ab4f4bc02c679cdec0fe408322b3a8cbab115a0 100644 (file)
@@ -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"
index 89a253f2e0a18120bfea4beec0bdc16199543726..4c4f94334badc04522b94ad2af80fdf6f3011cd9 100644 (file)
@@ -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
index 0227dc5c3351d2bdae600816539a89fb5a0dea03..0d3bf949423c393537f619de78253aeb580da039 100644 (file)
@@ -3,4 +3,4 @@
 OUTPUT_FORMAT="elf32-hppa"
 TEXT_START_ADDR=0x1000
 TARGET_PAGE_SIZE=0x1000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
index 3235ebea01a6eaf55bb7ca9ebe95ac45ef0f4323..18e0860c0f518b93ddd30026f5d45e0f133d8d04 100644 (file)
@@ -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=
index eece4473976c8c2afb15725b82188b694959e6ba..659c7f2c9d558e95944012e5376996f467d6bd7c 100644 (file)
@@ -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=
index e4872edec5116ddca85eb250d3971a70ab6b969f..256d4c8d14183430270192eb7212401c5ee86dbf 100644 (file)
@@ -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
index 621b4755b8bc2c0948470cf727c4e82e95cb79c9..dd5558cf0008770d11171d772006a439d79f78c3 100644 (file)
@@ -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
index be2ad23240cae0873c6ff9f34b852fea218753b9..9a4ee9778e94100e3013a05bd117150221b35e89 100644 (file)
@@ -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).
index b784a3ca54a31bc68d89ee17146529689ec20223..4771f6b50fafa8f0ce423a44dd4c80a45c623b76 100644 (file)
@@ -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=
index 34eb8ca549cecb45f4b5299ada16f63a0cca3af6..22d1598e0ec69c67c03dfc36c06adb08ef9bc2f6 100644 (file)
@@ -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
index 04d163038e59680449d496291fb8e2a58d3fb35f..5f6b46719fef72d7c8e1cf22dafe71ff970f4890 100644 (file)
@@ -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
index acfd2b346c5cacda280ca4950d91b48e47358fa6..97eba8fcb39a4bf73eac52777d90a8fd197f33cf 100644 (file)
@@ -1,5 +1,5 @@
 SCRIPT_NAME=elf
 OUTPUT_FORMAT="elf32-pj"
 TEXT_START_ADDR=0x1000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 ARCH=pj
index 35958fdea6a1929e09ae72af285a31110b2d1344..eb568105aa5e5f4f222ea29a4f8374260baf8ffe 100644 (file)
@@ -1,5 +1,5 @@
 SCRIPT_NAME=elf
 OUTPUT_FORMAT="elf32-pjl"
 TEXT_START_ADDR=0x1000000
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 ARCH=pj
index 2534687114ed98143cbb06998f2e5c5f7623feb4..5c5769ea79656d34599902e38f03cd7fb3268c09 100644 (file)
@@ -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=
index c3ead43675b8a259078964b5d869f09a9a02f12c..14b2745caad02f0eab30b24c132d6614546d0a3d 100644 (file)
@@ -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
index 14965ef95b5ecc3b9ebea7f9f0888fb64030dbe6..63aee8f408422563ab50516cabc577b1ff1e93f9 100644 (file)
@@ -5,7 +5,7 @@
 
 OUTPUT_FORMAT="elf32-sh64-nbsd"
 TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 
 ENTRY=__start
 
index 3fcd49254925659b40425546f7d749ffd182ea71..ad295e96845a715b5650bf6af3258bdc1f84c120 100644 (file)
@@ -5,7 +5,7 @@
 
 OUTPUT_FORMAT="elf32-sh-nbsd"
 TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
 
 DATA_START_SYMBOLS='__data_start = . ;';
 
index f2252fb845f3f49af3fa8f7b81f690f373e0634a..70a0610ad7eb705b07b5b1e2b87b7c6e95e62457 100644 (file)
@@ -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
index 59d4179d31242d1fcbdf63b3b44005abc805b04d..ba32e79e9e55a54dbc8a41e712f94789dc04d7ee 100644 (file)
@@ -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
index 528b7257f3b5d66d1a3196c7a7981c80f77be601..b06df26320758f3c9fac6032480d6dc61edd6057 100644 (file)
@@ -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
index d23e69a6c47a680330cfb2752e9f98d49eadd218..c6c04f6b29b57a1e1759e1ac33c13f11c193a063 100644 (file)
@@ -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
index 5a5e504edde2d4e9f8ba22c5fba6e16ac827b55d..82e96a4a7cd15b432d36a7a89e6839108248fed2 100644 (file)
@@ -1,3 +1,3 @@
 # Xtensa configuration settings.
 
-MAXPAGESIZE=0x1000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
index dffcff81b47081ffbef95edc038189e662af277c..cafb6c5b46cba5dc78640d00bd34a7869a9b659b 100644 (file)
@@ -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 e1aa62cc6cfc794cfd7439908c5538f41d3933a4..174e5b9f20ac2641d1a5c1363d12e6356bfa533f 100644 (file)
--- 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;
index fc2413ee6004703925dfb2a513452d4e11d6fae7..182f06066995af2363b9720948f5bf4fc89c5dda 100644 (file)
@@ -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.  
index c9d707e793e64950cc8256a6ca4a5bf46174baab..b33329dc30e18344640032bf6090c896a2500230 100644 (file)
@@ -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;
index 3829e6ae00a15597ce4001619493fe6b85e9ad47..1f9d2fa1734ec58be63185fb06a5b2b0acbe2a91 100644 (file)
@@ -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 ')'
index 56ec39164b4629dd8905bc12ccd7c26175286b12..10339dd1779f842d76334df965a4f34c47368b35 100644 (file)
@@ -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 */ }
index db87a40b6aa74e5fb91d9270e0002735ed5f5b19..88811904aed960333371c36f13fae9b798a65001 100644 (file)
@@ -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)
index f2ea63079bb06e1e8aa059b361dcec79437bf1df..405a18a01a2e6dba19c7bbdc5948c487a78b14d1 100644 (file)
@@ -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 (file)
index 0000000..77ba761
--- /dev/null
@@ -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 (file)
index 0000000..5b685b2
--- /dev/null
@@ -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 (file)
index 0000000..f7f2dbf
--- /dev/null
@@ -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 (file)
index 0000000..b64ee3a
--- /dev/null
@@ -0,0 +1,7 @@
+       .text
+       .global _start
+_start:
+       .long   0
+
+       .data
+       .long   0