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]

[commit] gdbserver: Unexpected missing PT_PHDR when running break-interp.exp


On Mon, 05 Mar 2012 17:38:18 +0100, Pedro Alves wrote:
> Maybe look at the elf's entry, and comparing that with AT_ENTRY, as GDB does.

Good idea.  I have put that into the comment.


> Great, please check it in.

Checked in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2012-03/msg00098.html

--- src/gdb/gdbserver/ChangeLog	2012/03/03 09:51:28	1.568
+++ src/gdb/gdbserver/ChangeLog	2012/03/05 17:09:37	1.569
@@ -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
--- src/gdb/gdbserver/linux-low.c	2012/03/03 04:34:51	1.200
+++ src/gdb/gdbserver/linux-low.c	2012/03/05 17:09:37	1.201
@@ -5250,7 +5250,16 @@
 
   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;
     }
 


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