2006-09-05 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Sep 2006 16:26:29 +0000 (16:26 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Sep 2006 16:26:29 +0000 (16:26 +0000)
PR ld/3015
* emultempl/elf32.em: Enable "-z relro" only if $COMMONPAGESIZE
is defined.

ld/ChangeLog
ld/emultempl/elf32.em

index 76bdc6593beed014473d9b23608d069310f0a952..939fef05dd556059b277424ab9e674c118d37ad3 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/3015
+       * emultempl/elf32.em: Enable "-z relro" only if $COMMONPAGESIZE
+       is defined.
+
 2006-08-29  Nathan Sidwell  <nathan@codesourcery.com>
 
        * ldlang.c (walk_wild): Allow * to glob '/' in wildcarded match.
index 7ce112a1c16ca50b1b8b3425107a7941343dfeac..38bceaa024cf31eb064efeda2714a18dc5b4017f 100644 (file)
@@ -1859,10 +1859,18 @@ cat >>e${EMULATION_NAME}.c <<EOF
          link_info.noexecstack = TRUE;
          link_info.execstack = FALSE;
        }
+EOF
+
+  if test -n "$COMMONPAGESIZE"; then
+cat >>e${EMULATION_NAME}.c <<EOF
       else if (strcmp (optarg, "relro") == 0)
        link_info.relro = TRUE;
       else if (strcmp (optarg, "norelro") == 0)
        link_info.relro = FALSE;
+EOF
+  fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
       else if (strncmp (optarg, "max-page-size=", 14) == 0)
        {
          char *end;
@@ -1928,10 +1936,26 @@ cat >>e${EMULATION_NAME}.c <<EOF
   fprintf (file, _("  -z nodlopen\t\tMark DSO not available to dlopen\n"));
   fprintf (file, _("  -z nodump\t\tMark DSO not available to dldump\n"));
   fprintf (file, _("  -z noexecstack\tMark executable as not requiring executable stack\n"));
+EOF
+
+  if test -n "$COMMONPAGESIZE"; then
+cat >>e${EMULATION_NAME}.c <<EOF
   fprintf (file, _("  -z norelro\t\tDon't create RELRO program header\n"));
+EOF
+  fi
+
+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"));
+EOF
+
+  if test -n "$COMMONPAGESIZE"; then
+cat >>e${EMULATION_NAME}.c <<EOF
   fprintf (file, _("  -z relro\t\tCreate RELRO program header\n"));
+EOF
+  fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
   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"));