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] Find the entry point even in a shared library


The comment speaks for itself.  Symbian executables are position
independent and linked as shared objects; I noticed that we were not
setting the entry point (which breaks e.g. dummy calls).  Tested
on arm-symbianelf, arm-eabi, x86_64-linux.  Checked in.

-- 
Daniel Jacobowitz
CodeSourcery

2008-05-02  Daniel Jacobowitz  <dan@codesourcery.com>

	* objfiles.c (init_entry_point_info): Handle shared libraries.

--- gdb/objfiles.c	(revision 197177)
+++ gdb/objfiles.c	(revision 197186)
@@ -248,6 +249,12 @@ init_entry_point_info (struct objfile *o
          the startup file because it contains the entry point.  */
       objfile->ei.entry_point = bfd_get_start_address (objfile->obfd);
     }
+  else if (bfd_get_file_flags (objfile->obfd) & DYNAMIC
+	   && bfd_get_start_address (objfile->obfd) != 0)
+    /* Some shared libraries may have entry points set and be
+       runnable.  There's no clear way to indicate this, so just check
+       for values other than zero.  */
+    objfile->ei.entry_point = bfd_get_start_address (objfile->obfd);    
   else
     {
       /* Examination of non-executable.o files.  Short-circuit this stuff.  */


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