+2007-01-19 Jakub Jelinek <jakub@redhat.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * emultempl/elf32.em (handle_option): Make sure -z max-page-size
+ or -z common-page-size argument is a power of 2. Call
+ bfd_emul_set_maxpagesize and bfd_emul_set_commonpagesize.
+
+2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ldmain.c (main): Don't call bfd_emul_set_maxpagesize nor
+ bfd_emul_set_commonpagesize.
+
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* NEWS: Mention --default-script/-dT.
char *end;
config.maxpagesize = strtoul (optarg + 14, &end, 0);
- if (*end)
+ if (*end || (config.maxpagesize & (config.maxpagesize - 1)) != 0)
einfo (_("%P%F: invalid maxium page size \`%s'\n"),
optarg + 14);
+ ASSERT (default_target != NULL);
+ bfd_emul_set_maxpagesize (default_target, config.maxpagesize);
}
else if (CONST_STRNEQ (optarg, "common-page-size="))
{
char *end;
config.commonpagesize = strtoul (optarg + 17, &end, 0);
- if (*end)
+ if (*end
+ || (config.commonpagesize & (config.commonpagesize - 1)) != 0)
einfo (_("%P%F: invalid common page size \`%s'\n"),
optarg + 17);
+ ASSERT (default_target != NULL);
+ bfd_emul_set_commonpagesize (default_target,
+ config.commonpagesize);
}
/* What about the other Solaris -z options? FIXME. */
break;
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)
+2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-elf/maxpage3.t: New file.
+ * ld-elf/maxpage3a.d: Likewise.
+ * ld-elf/maxpage3b.d: Likewise.
+ * ld-elf/maxpage3c.d: Likewise.
+
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld-scripts/default-script.exp: New file.
--- /dev/null
+SECTIONS
+{
+ .text : {*(.text)}
+ . = ALIGN(CONSTANT (MAXPAGESIZE));
+ .data : {*(.data)}
+ /DISCARD/ : {*(*)}
+}
--- /dev/null
+#source: maxpage1.s
+#ld: -z max-page-size=0x10000000 -T maxpage3.t
+#readelf: -lS --wide
+#target: *-*-linux*
+
+#...
+ \[[ 0-9]+\] \.data[ \t]+PROGBITS[ \t]+0*10000000[ \t]+[ \t0-9a-f]+WA?.*
+#...
+ LOAD+.*0x10000000
+ LOAD+.*0x10000000
+#pass
--- /dev/null
+#source: maxpage1.s
+#ld: -T maxpage3.t -z max-page-size=0x10000000
+#readelf: -lS --wide
+#target: x86_64-*-linux*
+
+#...
+ \[[ 0-9]+\] \.data[ \t]+PROGBITS[ \t]+0*200000[ \t]+[ \t0-9a-f]+WA?.*
+#...
+ LOAD+.*0x10000000
+#pass
--- /dev/null
+#source: maxpage1.s
+#as: --32
+#ld: -m elf_i386 -z max-page-size=0x10000000 -T maxpage3.t
+#readelf: -lS --wide
+#target: x86_64-*-linux*
+
+#...
+ \[[ 0-9]+\] \.data[ \t]+PROGBITS[ \t]+0*10000000[ \t]+[ \t0-9a-f]+WA?.*
+#...
+ LOAD+.*0x10000000
+ LOAD+.*0x10000000
+#pass