Page MenuHomeFreeBSD

D15367.id42308.diff
No OneTemporary

D15367.id42308.diff

Index: sys/amd64/amd64/machdep.c
===================================================================
--- sys/amd64/amd64/machdep.c
+++ sys/amd64/amd64/machdep.c
@@ -1556,18 +1556,18 @@
TSRAW(&thread0, TS_ENTER, __func__, NULL);
- /*
- * This may be done better later if it gets more high level
- * components in it. If so just link td->td_proc here.
- */
- proc_linkup0(&proc0, &thread0);
-
kmdp = init_ops.parse_preload_data(modulep);
identify_cpu1();
identify_hypervisor();
- /* link_elf_ireloc(kmdp); */
+ link_elf_ireloc(kmdp);
+
+ /*
+ * This may be done better later if it gets more high level
+ * components in it. If so just link td->td_proc here.
+ */
+ proc_linkup0(&proc0, &thread0);
/* Init basic tunables, hz etc */
init_param1();
@@ -1753,7 +1753,6 @@
cninit();
amd64_kdb_init();
}
- link_elf_ireloc(kmdp);
getmemsize(kmdp, physfree);
init_param2(physmem);
Index: sys/kern/link_elf.c
===================================================================
--- sys/kern/link_elf.c
+++ sys/kern/link_elf.c
@@ -1692,9 +1692,15 @@
{
struct elf_file eff;
elf_file_t ef;
+ volatile char *c;
+ size_t i;
ef = &eff;
- bzero(ef, sizeof(*ef));
+
+ /* Do not use bzero/memset before ireloc is done. */
+ for (c = (char *)ef, i = 0; i < sizeof(*ef); i++)
+ c[i] = 0;
+
ef->modptr = kmdp;
ef->dynamic = (Elf_Dyn *)&_DYNAMIC;
parse_dynamic(ef);

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 28, 2:28 AM (10 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28062480
Default Alt Text
D15367.id42308.diff (1 KB)

Event Timeline