This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR symtab/21126] Fix handling of fully zeroed PT_GNU_RELRO


On 02/09/2017 06:01 PM, Doug Evans via gdb-patches wrote:
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 4f52251a62..82904fe588 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -2777,25 +2777,10 @@ svr4_exec_displacement (CORE_ADDR *displacementp)

           /* Strip modifies the flags and alignment of PT_GNU_RELRO.
              CentOS-5 has problems with filesz, memsz as well.
-             See PR 11786.  */
+             And strip may now fully zero out the section, so just
+             ignore it. See PR 11786, 21126.  */

Two spaces after period.

@@ -2908,25 +2893,10 @@ svr4_exec_displacement (CORE_ADDR *displacementp)

           /* Strip modifies the flags and alignment of PT_GNU_RELRO.
              CentOS-5 has problems with filesz, memsz as well.
-             See PR 11786.  */
+             And strip may now fully zero out the section, so just
+             ignore it. See PR 11786, 21126.  */

Two spaces after period.

diff --git a/gdb/testsuite/gdb.server/stripped-pie.exp
b/gdb/testsuite/gdb.server/stripped-pie.exp
new file mode 100644
index 0000000000..330b0597b8
--- /dev/null
+++ b/gdb/testsuite/gdb.server/stripped-pie.exp
@@ -0,0 +1,55 @@
+# Copyright 2017 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# PR 21126
+# strip may completely nullify the PT_GNU_RELRO segment header.
+# Seeing this bug requires exec_bfd to be from the non-stripped binary,
+# with the in-memory image being from the stripped binary. And it seems
+# to require clang-built executables, not sure what the difference is that
+# triggers the complete nullification.
+
+load_lib gdbserver-support.exp
+
+standard_testfile server.c
+
+if { [skip_gdbserver_tests] } {

untested "skipping gdbserver tests"?

Otherwise looks OK to me.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]