+2019-10-20 Tom Tromey <tom@tromey.com>
+
+ * objfiles.h (unlink_objfile, put_objfile_before): Don't declare.
+ * objfiles.c (unlink_objfile): Move earlier. Now static. Remove
+ obsolete comment.
+ (put_objfile_before): Now static.
+
2019-10-19 Simon Marchi <simon.marchi@polymtl.ca>
* gdbsupport/common-utils.h (startswith): Change return type to
return *this;
}
+/* Unlink OBJFILE from the list of known objfiles. */
+
+static void
+unlink_objfile (struct objfile *objfile)
+{
+ struct objfile **objpp;
+
+ for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp)->next))
+ {
+ if (*objpp == objfile)
+ {
+ *objpp = (*objpp)->next;
+ objfile->next = NULL;
+ return;
+ }
+ }
+
+ internal_error (__FILE__, __LINE__,
+ _("unlink_objfile: objfile already unlinked"));
+}
+
/* Put one object file before a specified on in the global list.
This can be used to make sure an object file is destroyed before
another when using objfiles_safe to free all objfiles. */
-void
+static void
put_objfile_before (struct objfile *objfile, struct objfile *before_this)
{
struct objfile **objp;
_("put_objfile_before: before objfile not in list"));
}
-/* Unlink OBJFILE from the list of known objfiles, if it is found in the
- list.
-
- It is not a bug, or error, to call this function if OBJFILE is not known
- to be in the current list. This is done in the case of mapped objfiles,
- for example, just to ensure that the mapped objfile doesn't appear twice
- in the list. Since the list is threaded, linking in a mapped objfile
- twice would create a circular list.
-
- If OBJFILE turns out to be in the list, we zap it's NEXT pointer after
- unlinking it, just to ensure that we have completely severed any linkages
- between the OBJFILE and the list. */
-
-void
-unlink_objfile (struct objfile *objfile)
-{
- struct objfile **objpp;
-
- for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp)->next))
- {
- if (*objpp == objfile)
- {
- *objpp = (*objpp)->next;
- objfile->next = NULL;
- return;
- }
- }
-
- internal_error (__FILE__, __LINE__,
- _("unlink_objfile: objfile already unlinked"));
-}
-
/* Add OBJFILE as a separate debug objfile of PARENT. */
void
extern void build_objfile_section_table (struct objfile *);
-extern void put_objfile_before (struct objfile *, struct objfile *);
-
extern void add_separate_debug_objfile (struct objfile *, struct objfile *);
-extern void unlink_objfile (struct objfile *);
-
extern void free_objfile_separate_debug (struct objfile *);
extern void free_all_objfiles (void);