public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "PR28824, relro security issues, x86 keep COMMONPAGESIZE relro"
@ 2022-02-15  1:10 H.J. Lu
  2022-02-15  1:10 ` [PATCH 2/2] x86-64: Use MAXPAGESIZE for the relro segment alignment H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2022-02-15  1:10 UTC (permalink / raw)
  To: binutils

This reverts commit 31b4d3a16f200bf04db8439a63b72bba7af4e1be.
---
 ld/emultempl/elf-x86.em          | 1 -
 ld/ld.h                          | 4 ----
 ld/ldexp.c                       | 5 +----
 ld/testsuite/ld-x86-64/pr18176.d | 1 -
 4 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/ld/emultempl/elf-x86.em b/ld/emultempl/elf-x86.em
index 134e4e1b616..f75521cecea 100644
--- a/ld/emultempl/elf-x86.em
+++ b/ld/emultempl/elf-x86.em
@@ -33,7 +33,6 @@ static struct elf_linker_x86_params params;
 static void
 elf_x86_create_output_section_statements (void)
 {
-  config.relro_use_commonpagesize = true;
   _bfd_elf_linker_x86_set_options (&link_info, &params);
 }
 
diff --git a/ld/ld.h b/ld/ld.h
index c7e4ca3d334..f3086bf30de 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -276,10 +276,6 @@ typedef struct
   /* If set, code and non-code sections should never be in one segment.  */
   bool separate_code;
 
-  /* TRUE if the end of the relro segment should be aligned to
-     COMMONPAGESIZE rather than MAXPAGESIZE.  */
-  bool relro_use_commonpagesize;
-
   /* The rpath separation character.  Usually ':'.  */
   char rpath_separator;
 
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 90760e0a8ca..c18b8284ca5 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -485,10 +485,7 @@ fold_segment_align (etree_value_type *lhs)
 	      seg->base = expld.result.value;
 	      seg->commonpagesize = commonpage;
 	      seg->maxpagesize = maxpage;
-	      if (config.relro_use_commonpagesize)
-		seg->relropagesize = commonpage;
-	      else
-		seg->relropagesize = maxpage;
+	      seg->relropagesize = maxpage;
 	      seg->relro_end = 0;
 	    }
 	  else
diff --git a/ld/testsuite/ld-x86-64/pr18176.d b/ld/testsuite/ld-x86-64/pr18176.d
index 728c15a3dd8..a99ff15ac6b 100644
--- a/ld/testsuite/ld-x86-64/pr18176.d
+++ b/ld/testsuite/ld-x86-64/pr18176.d
@@ -3,7 +3,6 @@
 #ld: -melf_x86_64 -shared -z relro -T pr18176.t -z max-page-size=0x200000 -z common-page-size=0x1000 $NO_DT_RELR_LDFLAGS
 #readelf: -l --wide
 #target: x86_64-*-linux*
-#xfail: *-*-*
 
 #...
   GNU_RELRO      0x04bd17 0x000000000024bd17 0x000000000024bd17 0x0022e9 0x0022e9 R   0x1
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-15 14:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15  1:10 [PATCH 1/2] Revert "PR28824, relro security issues, x86 keep COMMONPAGESIZE relro" H.J. Lu
2022-02-15  1:10 ` [PATCH 2/2] x86-64: Use MAXPAGESIZE for the relro segment alignment H.J. Lu
2022-02-15 14:08   ` Michael Matz
2022-02-15 14:41     ` H.J. Lu
2022-02-15 14:57       ` Michael Matz

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).