* [patch 15/15] PIE: Drop PIE "GDB does NOT currently support"
@ 2009-11-09 21:01 Jan Kratochvil
2009-11-09 21:53 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2009-11-09 21:01 UTC (permalink / raw)
To: gdb-patches
Hi,
no longer true.
Thanks,
Jan
gdb/
* linux-tdep.c: Remove includes gdbcore.h, observer.h and elf-bfd.h.
(check_is_pie_binary, _initialize_linux_tdep): Remove.
gdb/testsuite/
* gdb.base/pie-support.exp, gdb.base/pie-support.c: Remove.
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -18,13 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
#include "gdbtypes.h"
#include "linux-tdep.h"
-#include "observer.h"
#include "auxv.h"
#include "target.h"
-#include "elf-bfd.h"
#include "elf/common.h"
/* This function is suitable for architectures that don't
@@ -155,33 +152,3 @@ linux_has_shared_address_space (void)
return target_is_uclinux;
}
-
-/* Observer for the executable_changed event, to check whether the new
- exec binary is a PIE (Position Independent Executable) specimen, which
- is currently unsupported. */
-
-static void
-check_is_pie_binary (void)
-{
- Elf_Internal_Ehdr *elf_hdr;
-
- if (!exec_bfd)
- return;
- else if (bfd_get_flavour (exec_bfd) != bfd_target_elf_flavour)
- return;
-
- if (elf_tdata (exec_bfd)->elf_header->e_type == ET_DYN)
- warning (_("\
-The current binary is a PIE (Position Independent Executable), which\n\
-GDB does NOT currently support. Most debugger features will fail if used\n\
-in this session.\n"));
-}
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_linux_tdep;
-
-void
-_initialize_linux_tdep (void)
-{
- observer_attach_executable_changed (check_is_pie_binary);
-}
--- a/gdb/testsuite/gdb.base/pie-support.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This testcase is part of GDB, the GNU debugger.
-
- Copyright 2009 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/>.
-
-*/
-
-#include <stdio.h>
-
-void
-f1 (int a)
-{
- printf ("a = %d\n", a);
-}
-
-int
-main (int argc, char *argv[])
-{
- f1 (1);
-
- return 0;
-}
--- a/gdb/testsuite/gdb.base/pie-support.exp
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2009 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/>.
-
-set testfile pie-support
-set srcfile ${testfile}.c
-set objfile ${objdir}/${subdir}/${testfile}.o
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {quiet debug additional_flags=-fpie}] != "" } {
- untested "Couldn't compile test PIE object file."
- return -1
-}
-if { [gdb_compile "${objfile}" "${binfile}" executable {quiet debug additional_flags=-pie}] != "" } {
- untested "Couldn't compile test PIE binary."
- return -1
-}
-
-# Get things started.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-if [is_remote host] {
- set binfile [remote_download host $binfile]
- if { $binfile == "" } {
- untested "Couldn't download remote test binary."
- return -1
- }
-}
-
-# The file command used to kill the remote target. For the benefit
-# of the testsuite, preserve this behavior.
-send_gdb "kill\n"
-gdb_expect 120 {
- -re "Kill the program being debugged. .y or n. $" {
- send_gdb "y\n"
- verbose "\t\tKilling previous program being debugged"
- exp_continue
- }
- -re "$gdb_prompt $" {
- # OK.
- }
-}
-
-gdb_test "file $binfile" "current binary is a PIE.*" "correctly detected PIE binary"
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch 15/15] PIE: Drop PIE "GDB does NOT currently support"
2009-11-09 21:01 [patch 15/15] PIE: Drop PIE "GDB does NOT currently support" Jan Kratochvil
@ 2009-11-09 21:53 ` Tom Tromey
2010-01-14 21:22 ` Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2009-11-09 21:53 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> gdb/
Jan> * linux-tdep.c: Remove includes gdbcore.h, observer.h and elf-bfd.h.
Jan> (check_is_pie_binary, _initialize_linux_tdep): Remove.
Jan> gdb/testsuite/
Jan> * gdb.base/pie-support.exp, gdb.base/pie-support.c: Remove.
This is ok once the rest of the series is approved.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 15/15] PIE: Drop PIE "GDB does NOT currently support"
2009-11-09 21:53 ` Tom Tromey
@ 2010-01-14 21:22 ` Jan Kratochvil
2010-01-14 21:52 ` Michael Snyder
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2010-01-14 21:22 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On Mon, 09 Nov 2009 22:53:43 +0100, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
>
> Jan> gdb/
> Jan> * linux-tdep.c: Remove includes gdbcore.h, observer.h and elf-bfd.h.
> Jan> (check_is_pie_binary, _initialize_linux_tdep): Remove.
> Jan> gdb/testsuite/
> Jan> * gdb.base/pie-support.exp, gdb.base/pie-support.c: Remove.
>
> This is ok once the rest of the series is approved.
Checked-in.
+ * gdb.base/pie-support.exp, gdb.base/pie-support.c: Remove.
These files were really removed but cvsweb has some bug so the removal is not
present in the attachment below.
http://sourceware.org/ml/gdb-cvs/2010-01/msg00127.html
->
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/Attic/pie-support.c.diff
Error: src/gdb/testsuite/gdb.base/Attic/pie-support.c.diff: no such file or directory
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/Attic/pie-support.exp.diff
Error: src/gdb/testsuite/gdb.base/Attic/pie-support.exp.diff: no such file or directory
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-01/msg00127.html
--- src/gdb/ChangeLog 2010/01/14 21:16:51 1.11251
+++ src/gdb/ChangeLog 2010/01/14 21:20:09 1.11252
@@ -1,5 +1,10 @@
2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * linux-tdep.c: Remove includes gdbcore.h, observer.h and elf-bfd.h.
+ (check_is_pie_binary, _initialize_linux_tdep): Remove.
+
+2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* solib-svr4.c (svr4_exec_displacement): New comment for entry_point.
Replace exec_entry_point call by bfd_get_start_address.
--- src/gdb/linux-tdep.c 2010/01/01 07:31:37 1.6
+++ src/gdb/linux-tdep.c 2010/01/14 21:20:11 1.7
@@ -18,13 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdbcore.h"
#include "gdbtypes.h"
#include "linux-tdep.h"
-#include "observer.h"
#include "auxv.h"
#include "target.h"
-#include "elf-bfd.h"
#include "elf/common.h"
/* This function is suitable for architectures that don't
@@ -155,33 +152,3 @@
return target_is_uclinux;
}
-
-/* Observer for the executable_changed event, to check whether the new
- exec binary is a PIE (Position Independent Executable) specimen, which
- is currently unsupported. */
-
-static void
-check_is_pie_binary (void)
-{
- Elf_Internal_Ehdr *elf_hdr;
-
- if (!exec_bfd)
- return;
- else if (bfd_get_flavour (exec_bfd) != bfd_target_elf_flavour)
- return;
-
- if (elf_tdata (exec_bfd)->elf_header->e_type == ET_DYN)
- warning (_("\
-The current binary is a PIE (Position Independent Executable), which\n\
-GDB does NOT currently support. Most debugger features will fail if used\n\
-in this session.\n"));
-}
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_linux_tdep;
-
-void
-_initialize_linux_tdep (void)
-{
- observer_attach_executable_changed (check_is_pie_binary);
-}
--- src/gdb/testsuite/ChangeLog 2010/01/14 21:15:00 1.2088
+++ src/gdb/testsuite/ChangeLog 2010/01/14 21:20:12 1.2089
@@ -1,5 +1,9 @@
2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * gdb.base/pie-support.exp, gdb.base/pie-support.c: Remove.
+
+2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* gdb.base/valgrind-db-attach.exp, gdb.base/valgrind-db-attach.c: New.
2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch 15/15] PIE: Drop PIE "GDB does NOT currently support"
2010-01-14 21:22 ` Jan Kratochvil
@ 2010-01-14 21:52 ` Michael Snyder
0 siblings, 0 replies; 4+ messages in thread
From: Michael Snyder @ 2010-01-14 21:52 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Tom Tromey, gdb-patches
Jan Kratochvil wrote:
> On Mon, 09 Nov 2009 22:53:43 +0100, Tom Tromey wrote:
>>>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
>> Jan> gdb/
>> Jan> * linux-tdep.c: Remove includes gdbcore.h, observer.h and elf-bfd.h.
>> Jan> (check_is_pie_binary, _initialize_linux_tdep): Remove.
>> Jan> gdb/testsuite/
>> Jan> * gdb.base/pie-support.exp, gdb.base/pie-support.c: Remove.
>>
>> This is ok once the rest of the series is approved.
>
> Checked-in.
Tested and working.
This makes me very happy.
Thanks, Jan!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-14 21:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-09 21:01 [patch 15/15] PIE: Drop PIE "GDB does NOT currently support" Jan Kratochvil
2009-11-09 21:53 ` Tom Tromey
2010-01-14 21:22 ` Jan Kratochvil
2010-01-14 21:52 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox