Skip to content

Commit 7d6b5a9

Browse files
committed
rtld: Add UTRACE_LOAD_OBJECT traces for rtld and the main binary
These two objects are loaded by the kernel not rtld, but adding these two traces means that UTRACE_LOAD_OBJECT traces now describe the mappings for all executables and DSOs in a process' address space. Reviewed by: kib Obtained from: CheriBSD Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D52034
1 parent e679319 commit 7d6b5a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libexec/rtld-elf/rtld.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,10 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
859859

860860
linkmap_add(obj_main);
861861
linkmap_add(&obj_rtld);
862+
LD_UTRACE(UTRACE_LOAD_OBJECT, obj_main, obj_main->mapbase,
863+
obj_main->mapsize, 0, obj_main->path);
864+
LD_UTRACE(UTRACE_LOAD_OBJECT, &obj_rtld, obj_rtld.mapbase,
865+
obj_rtld.mapsize, 0, obj_rtld.path);
862866

863867
/* Link the main program into the list of objects. */
864868
TAILQ_INSERT_HEAD(&obj_list, obj_main, next);

0 commit comments

Comments
 (0)