Move init_entry_point_info to symfile.c and make it static.
authorJoel Brobecker <brobecker@gnat.com>
Sat, 15 Dec 2012 13:11:18 +0000 (13:11 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Sat, 15 Dec 2012 13:11:18 +0000 (13:11 +0000)
gdb/ChangeLog:

        * objfiles.c (init_entry_point_info): Move function from here...
        * symfile.c (init_entry_point_info): ... to there.  Make static.
        * objfiles.h (objfiles.h): Delete declaration.

gdb/ChangeLog
gdb/objfiles.c
gdb/objfiles.h
gdb/symfile.c

index aeb7b49334c8761e3fe1e8b94d400821e0f0f7a6..ae4a926b5447f4e7fe4a5f7bacaff746efac2041 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-15  Joel Brobecker  <brobecker@adacore.com>
+
+       * objfiles.c (init_entry_point_info): Move function from here...
+       * symfile.c (init_entry_point_info): ... to there.  Make static.
+       * objfiles.h (objfiles.h): Delete declaration.
+
 2012-12-15  Joel Brobecker  <brobecker@adacore.com>
 
        * symfile.c (syms_from_objfile_1): Renames syms_from_objfile.
index e5681fa7ade32c6a1cb3a26f43d3865d416c58fe..feb387b1bad71f6e6239d981c9c060cc8db8e6d5 100644 (file)
@@ -324,54 +324,6 @@ get_objfile_arch (struct objfile *objfile)
   return objfile->gdbarch;
 }
 
-/* Initialize entry point information for this objfile.  */
-
-void
-init_entry_point_info (struct objfile *objfile)
-{
-  /* Save startup file's range of PC addresses to help blockframe.c
-     decide where the bottom of the stack is.  */
-
-  if (bfd_get_file_flags (objfile->obfd) & EXEC_P)
-    {
-      /* Executable file -- record its entry point so we'll recognize
-         the startup file because it contains the entry point.  */
-      objfile->ei.entry_point = bfd_get_start_address (objfile->obfd);
-      objfile->ei.entry_point_p = 1;
-    }
-  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);
-      objfile->ei.entry_point_p = 1;
-    }
-  else
-    {
-      /* Examination of non-executable.o files.  Short-circuit this stuff.  */
-      objfile->ei.entry_point_p = 0;
-    }
-
-  if (objfile->ei.entry_point_p)
-    {
-      CORE_ADDR entry_point =  objfile->ei.entry_point;
-
-      /* Make certain that the address points at real code, and not a
-        function descriptor.  */
-      entry_point
-       = gdbarch_convert_from_func_ptr_addr (objfile->gdbarch,
-                                             entry_point,
-                                             &current_target);
-
-      /* Remove any ISA markers, so that this matches entries in the
-        symbol table.  */
-      objfile->ei.entry_point
-       = gdbarch_addr_bits_remove (objfile->gdbarch, entry_point);
-    }
-}
-
 /* If there is a valid and known entry point, function fills *ENTRY_P with it
    and returns non-zero; otherwise it returns zero.  */
 
index 877c9e0894f5964cf091fe4fd5b7ff62407e150f..c79459805f6a617e44bc28d30b13d8902c58d07f 100644 (file)
@@ -443,8 +443,6 @@ extern struct objfile *allocate_objfile (bfd *, int);
 
 extern struct gdbarch *get_objfile_arch (struct objfile *);
 
-extern void init_entry_point_info (struct objfile *);
-
 extern int entry_point_address_query (CORE_ADDR *entry_p);
 
 extern CORE_ADDR entry_point_address (void);
index 2a152938980fcd1be3366dd54021139d4f20b57c..fc908b3caab87c89a21118d81ec87617d6d06238 100644 (file)
@@ -893,6 +893,54 @@ read_symbols (struct objfile *objfile, int add_flags)
     require_partial_symbols (objfile, 0);
 }
 
+/* Initialize entry point information for this objfile.  */
+
+static void
+init_entry_point_info (struct objfile *objfile)
+{
+  /* Save startup file's range of PC addresses to help blockframe.c
+     decide where the bottom of the stack is.  */
+
+  if (bfd_get_file_flags (objfile->obfd) & EXEC_P)
+    {
+      /* Executable file -- record its entry point so we'll recognize
+         the startup file because it contains the entry point.  */
+      objfile->ei.entry_point = bfd_get_start_address (objfile->obfd);
+      objfile->ei.entry_point_p = 1;
+    }
+  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);
+      objfile->ei.entry_point_p = 1;
+    }
+  else
+    {
+      /* Examination of non-executable.o files.  Short-circuit this stuff.  */
+      objfile->ei.entry_point_p = 0;
+    }
+
+  if (objfile->ei.entry_point_p)
+    {
+      CORE_ADDR entry_point =  objfile->ei.entry_point;
+
+      /* Make certain that the address points at real code, and not a
+        function descriptor.  */
+      entry_point
+       = gdbarch_convert_from_func_ptr_addr (objfile->gdbarch,
+                                             entry_point,
+                                             &current_target);
+
+      /* Remove any ISA markers, so that this matches entries in the
+        symbol table.  */
+      objfile->ei.entry_point
+       = gdbarch_addr_bits_remove (objfile->gdbarch, entry_point);
+    }
+}
+
 /* Process a symbol file, as either the main file or as a dynamically
    loaded file.
 
This page took 0.035694 seconds and 4 git commands to generate.