public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Enable "-z relro" only if it is supported
@ 2006-08-23 18:36 H. J. Lu
  0 siblings, 0 replies; only message in thread
From: H. J. Lu @ 2006-08-23 18:36 UTC (permalink / raw)
  To: binutils

There are 2 "-z relro" test failures on Linux/ia64. It is because
"-z relro" is supported only if $COMMONPAGESIZE is defined and
$COMMONPAGESIZE isn't defined for Linux/ia64. This patch enables
"-z relro" only if $COMMONPAGESIZE is defined.


H.J.
----
2006-08-23  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em: Enable "-z relro" only if $COMMONPAGESIZE
	is defined.

--- ld/emultempl/elf32.em.relro	2006-07-11 12:53:43.000000000 -0700
+++ ld/emultempl/elf32.em	2006-08-23 10:42:53.000000000 -0700
@@ -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"));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-23 17:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-23 18:36 PATCH: Enable "-z relro" only if it is supported H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).