]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hppa: Always enable PIE on 64-bit target
authorJohn David Anglin <danglin@gcc.gnu.org>
Thu, 18 Jan 2024 22:46:19 +0000 (22:46 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 18 Jan 2024 22:46:19 +0000 (22:46 +0000)
2024-01-18  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

PR tree-optimization/69807
* config/pa/pa.cc (pa_option_override): Set flag_pie on TARGET_64BIT.

gcc/testsuite/ChangeLog:

* gcc.dg/pic-2.c: Skip on hppa*64*-*-*.

gcc/config/pa/pa.cc
gcc/testsuite/gcc.dg/pic-2.c

index 48a370cdc200116306855b360b1ca5b357f9670f..c58b0a0d75e130112cb6286a9ef56af8d441d56a 100644 (file)
@@ -557,6 +557,10 @@ pa_option_override (void)
   if (flag_pic == 1 || TARGET_64BIT)
     flag_pic = 2;
 
+  /* 64-bit target is always PIE.  */
+  if (TARGET_64BIT)
+    flag_pie = 2;
+
   /* Disable -freorder-blocks-and-partition as we don't support hot and
      cold partitioning.  */
   if (flag_reorder_blocks_and_partition)
index 24260538cc0a5f8c14ef95eaae021534fa5a1094..074684604bc0c9eacd6d34a498968ef78ec037e2 100644 (file)
@@ -3,6 +3,7 @@
 /* { dg-options "-fPIC" } */
 /* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */
 /* { dg-skip-if "__PIE__ is always defined for GCN" { amdgcn*-*-* } } */
+/* { dg-skip-if "__PIE__ is always defined for hppa64" { hppa*64*-*-* } } */
 
 #if defined(__CYGWIN__) || defined(__WIN32__)
 # if __PIC__ != 1