Use Kernel mapped binaries when available.
At least in linux kernel, assuming that a.out is an elf that is linked against relibc's own ld.so. When a user attempts `./a.out`, Linux kernel will map `./a.out`, then map `ld.so` and jump into ld.so entry point. In relibc ld.so will simply ignore the kernel mapped a.out and create its own mapping. This patch forces relic ld.so to use the already mapped `a.out` when ever possible. This would normally have slight performance improvement (especially that currently relibc doesn't map a.out but instead copy the data into empty mmaped memory). The real motivation behind this patch is while impelemnting Runtime linker debugging protocol for relibc. part of the protocol is ld.so inseting address of some ld.so managed data structure into .dynamic seciton of a.out then the debugger would check it there. The thing is that debuggers have information about the kernel loaded ./a.out and they check that one specifically which is in our case totally ignored by relibc.
Loading
Please register or sign in to comment