Page MenuHomeFreeBSD

D30455.id89829.diff
No OneTemporary

D30455.id89829.diff

Index: sys/kern/imgact_elf.c
===================================================================
--- sys/kern/imgact_elf.c
+++ sys/kern/imgact_elf.c
@@ -1434,12 +1434,6 @@
Elf_Off offset; /* Offset of segment in core file */
};
-/* Closure for cb_size_segment(). */
-struct sseg_closure {
- int count; /* Count of writable segments. */
- size_t size; /* Total size of all writable segments. */
-};
-
typedef void (*outfunc_t)(void *, struct sbuf *, size_t *);
struct note_info {
@@ -1463,7 +1457,6 @@
struct note_info_list *, size_t, int);
static void __elfN(prepare_notes)(struct thread *, struct note_info_list *,
size_t *);
-static void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int);
static void __elfN(putnote)(struct note_info *, struct sbuf *);
static size_t register_note(struct note_info_list *, int, outfunc_t, void *);
@@ -1508,9 +1501,7 @@
TAILQ_INIT(&notelst);
/* Size the program segments. */
- seginfo.count = 0;
- seginfo.size = 0;
- each_dumpable_segment(td, cb_size_segment, &seginfo, flags);
+ __elfN(size_segments)(td, &seginfo);
/*
* Collect info about the core file header area.
@@ -1645,6 +1636,15 @@
ssc->size += entry->end - entry->start;
}
+void
+__elfN(size_segments)(struct thread *td, struct sseg_closure *seginfo)
+{
+ seginfo->count = 0;
+ seginfo->size = 0;
+
+ each_dumpable_segment(td, cb_size_segment, seginfo, 0);
+}
+
/*
* For each writable segment in the process's memory map, call the given
* function with a pointer to the map entry and some arbitrary
@@ -1803,7 +1803,7 @@
*sizep = size;
}
-static void
+void
__elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs,
size_t notesz, int flags)
{
Index: sys/sys/imgact_elf.h
===================================================================
--- sys/sys/imgact_elf.h
+++ sys/sys/imgact_elf.h
@@ -100,6 +100,16 @@
#define MAX_BRANDS 8
+/*
+ * Structures used for core dumping code.
+ */
+
+/* Closure for cb_size_segment(). */
+struct sseg_closure {
+ int count; /* Count of writable segments. */
+ size_t size; /* Total size of all writable segments. */
+};
+
int __elfN(brand_inuse)(Elf_Brandinfo *entry);
int __elfN(insert_brand_entry)(Elf_Brandinfo *entry);
int __elfN(remove_brand_entry)(Elf_Brandinfo *entry);
@@ -108,6 +118,8 @@
size_t __elfN(populate_note)(int, void *, void *, size_t, void **);
void __elfN(stackgap)(struct image_params *, uintptr_t *);
int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t);
+void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int);
+void __elfN(size_segments)(struct thread *td, struct sseg_closure *seginfo);
/* Machine specific function to dump per-thread information. */
void __elfN(dump_thread)(struct thread *, void *, size_t *);

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 19, 9:15 AM (2 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29940747
Default Alt Text
D30455.id89829.diff (2 KB)

Event Timeline