summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/ld/testsuite/ld-elf/binutils.exp
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.25/ld/testsuite/ld-elf/binutils.exp')
-rw-r--r--binutils-2.25/ld/testsuite/ld-elf/binutils.exp26
1 files changed, 25 insertions, 1 deletions
diff --git a/binutils-2.25/ld/testsuite/ld-elf/binutils.exp b/binutils-2.25/ld/testsuite/ld-elf/binutils.exp
index 01015125..4ade8cb8 100644
--- a/binutils-2.25/ld/testsuite/ld-elf/binutils.exp
+++ b/binutils-2.25/ld/testsuite/ld-elf/binutils.exp
@@ -1,5 +1,5 @@
# Expect script for binutils tests
-# Copyright 2006, 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
@@ -79,6 +79,30 @@ proc binutils_test { prog_name ld_options test {test_name ""}} {
return
}
+ if [string match "*-z relro*" $ld_options] {
+ # Check if GNU_RELRO segment is generated.
+ set got [remote_exec host "grep GNU_RELRO tmpdir/$test.exp"]
+ if { ![string match "*GNU_RELRO*" $got] } then {
+ set got [remote_exec host "cat tmpdir/$test.exp"]
+ if { [string match "*.data.rel.ro*" $got]
+ || [string match "*.dynamic*" $got]
+ || [string match "*.got*" $got]
+ || [string match "*.eh_frame*" $got]
+ || [string match "*.gcc_except_table*" $got]
+ || [string match "*.exception_ranges*" $got]
+ || [string match "*.ctors*" $got]
+ || [string match "*.dtors*" $got]
+ || [string match "*.tdata*" $got]
+ || [string match "*.preinit_array*" $got]
+ || [string match "*.init_array*" $got]
+ || [string match "*.fini_array*" $got] } then {
+ # Fail if GNU_RELRO segment isn't generated, but should.
+ fail "$test_name"
+ return
+ }
+ }
+ }
+
send_log "$prog tmpdir/$test\n"
set got [remote_exec host "$prog tmpdir/$test"]
if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {