Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Use pie instead of -fpie/-pie
@ 2021-09-24 14:57 Tom de Vries via Gdb-patches
  0 siblings, 0 replies; only message in thread
From: Tom de Vries via Gdb-patches @ 2021-09-24 14:57 UTC (permalink / raw)
  To: gdb-patches

Hi,

I noticed two test-cases where -fpie is used.  Using the canonical pie option
will usually get one -fPIE instead.

That choice is justified here in gdb_compile:
...
  # For safety, use fPIE rather than fpie. On AArch64, m68k, PowerPC
  # and SPARC, fpie can cause compile errors due to the GOT exceeding
  # a maximum size.  On other architectures the two flags are
  # identical (see the GCC manual). Note Debian9 and Ubuntu16.10
  # onwards default GCC to using fPIE.  If you do require fpie, then
  # it can be set using the pie_flag.
  set flag "additional_flags=-fPIE"
...

There is no indication that using -fpie rather than -fPIE is on purpose, so
use pie instead.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Use pie instead of -fpie/-pie

---
 gdb/testsuite/gdb.base/gcore-relro-pie.exp | 3 ++-
 gdb/testsuite/gdb.base/gcore-tls-pie.exp   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/gcore-relro-pie.exp b/gdb/testsuite/gdb.base/gcore-relro-pie.exp
index 5b25721ad61..39142fe4254 100644
--- a/gdb/testsuite/gdb.base/gcore-relro-pie.exp
+++ b/gdb/testsuite/gdb.base/gcore-relro-pie.exp
@@ -19,7 +19,8 @@
 
 standard_testfile
 
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug additional_flags=-fpie "ldflags=-pie -Wl,-z,relro"}]} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+	 {debug pie "ldflags=-Wl,-z,relro"}]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/gcore-tls-pie.exp b/gdb/testsuite/gdb.base/gcore-tls-pie.exp
index 3f42cb4fe67..e514c42d498 100644
--- a/gdb/testsuite/gdb.base/gcore-tls-pie.exp
+++ b/gdb/testsuite/gdb.base/gcore-tls-pie.exp
@@ -23,7 +23,8 @@ if { [have_fuse_ld_gold] == 0} {
     return -1
 }
 
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug additional_flags=-fpie "ldflags=-pie -fuse-ld=gold"}]} {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+	 {debug pie "ldflags=-fuse-ld=gold"}]} {
     return -1
 }
 

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

only message in thread, other threads:[~2021-09-24 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 14:57 [committed][gdb/testsuite] Use pie instead of -fpie/-pie Tom de Vries via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox