aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-03-05 17:09:37 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-03-05 17:09:37 +0000
commite237a7e2c51159a40c2a623a379c2086610b5e55 (patch)
tree781e9183eb94930ca5aa618271752ad9e2f969f8
parent275418ae46da3806f6f9f3f59f3f496052813082 (diff)
downloadgdb-e237a7e2c51159a40c2a623a379c2086610b5e55.zip
gdb-e237a7e2c51159a40c2a623a379c2086610b5e55.tar.gz
gdb-e237a7e2c51159a40c2a623a379c2086610b5e55.tar.bz2
gdb/gdbserver/
* linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found. New comment why.
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/linux-low.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index db1fa92..e1005ee 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-05 Pedro Alves <palves@redhat.com>
+ Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
+ New comment why.
+
2012-03-03 Yao Qi <yao@codesourcery.com>
* tracepoint.c (tracepoint_look_up_symbols): Update call to
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f062575..4f8ec6b 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -5250,7 +5250,16 @@ get_dynamic (const int pid, const int is_elf64)
if (relocation == -1)
{
- warning ("Unexpected missing PT_PHDR");
+ /* PT_PHDR is optional, but necessary for PIE in general. Fortunately
+ any real world executables, including PIE executables, have always
+ PT_PHDR present. PT_PHDR is not present in some shared libraries or
+ in fpc (Free Pascal 2.4) binaries but neither of those have a need for
+ or present DT_DEBUG anyway (fpc binaries are statically linked).
+
+ Therefore if there exists DT_DEBUG there is always also PT_PHDR.
+
+ GDB could find RELOCATION also from AT_ENTRY - e_entry. */
+
return 0;
}