freebsd-dev/libexec/rtld-elf
Edward Tomasz Napierala b4ed9a87f9 Remove unneeded calls to access(2) from rtld(1); just call open(2) instead.
The result looks like this:

--- przed       2017-10-21 23:19:21.445034000 +0100
+++ po  2017-10-21 23:18:50.031865000 +0100
@@ -11,7 +11,6 @@ mmap(0x0,102,PROT_READ,MAP_PRIVATE,3,0x0)      = 343665418
 close(3)                                        = 0 (0x0)
 open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
 munmap(0x80067d000,102)                                 = 0 (0x0)
-access("/usr/local/lib/libintl.so.8",F_OK)      = 0 (0x0)
 openat(AT_FDCWD,"/usr/local/lib/libintl.so.8",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=642560,size=55188,blksize=32768 }) = 0 (0x0)
 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366541824 (0x80067d000)
@@ -20,14 +19,13 @@ mmap(0x800877000,40960,PROT_READ|PROT_EXEC,MAP_PRIVATE
 mmap(0x800a81000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0xa000) = 34370752512 (0x800a81000)
 munmap(0x80067d000,4096)                        = 0 (0x0)
 close(3)                                        = 0 (0x0)
-access("/usr/local/lib/libc.so.7",F_OK)                 ERR#2 'No such file or directory'
+openat(AT_FDCWD,"/usr/local/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'
 openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
 read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-2\0\0"...,128) = 128 (0x80)
 fstat(3,{ mode=-r--r--r-- ,inode=970684,size=306,blksize=32768 }) = 0 (0x0)
 lseek(3,0x80,SEEK_SET)                          = 128 (0x80)
 read(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,178) = 178 (0xb2)
 close(3)                                        = 0 (0x0)
-access("/lib/libc.so.7",F_OK)                   = 0 (0x0)
 openat(AT_FDCWD,"/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
 fstat(3,{ mode=-r--r--r-- ,inode=1605239,size=1910320,blksize=32768 }) = 0 (0x0)
 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366541824 (0x80067d000)

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12766
2017-10-24 12:56:08 +00:00
..
aarch64 Implement LD_BIND_NOT knob for rtld. 2017-03-15 21:11:57 +00:00
amd64 Implement LD_BIND_NOT knob for rtld. 2017-03-15 21:11:57 +00:00
arm End softfp->hardfp transition period for arm 2017-09-12 17:06:35 +00:00
i386 Implement LD_BIND_NOT knob for rtld. 2017-03-15 21:11:57 +00:00
mips Handle relocations for newer non-PIC MIPS ABI. 2017-09-12 17:46:30 +00:00
powerpc rtld: fix warnings about redundant declarations 2017-05-26 15:55:03 +00:00
powerpc64 rtld: fix warnings about redundant declarations 2017-05-26 15:55:03 +00:00
riscv Support for v1.10 (latest) of RISC-V privilege specification. 2017-08-10 14:18:09 +00:00
sparc64 Implement LD_BIND_NOT knob for rtld. 2017-03-15 21:11:57 +00:00
tests Increase WARNS for rtld-elf tests 2017-03-11 00:10:40 +00:00
debug.c Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and 2016-01-20 07:21:33 +00:00
debug.h Remove historical GNUC test 2015-05-06 15:29:11 +00:00
libmap.c Use xmalloc and read(2) instead of mmap(2) to read in libmap.conf(5). 2017-10-24 10:48:26 +00:00
libmap.h Make the directory mapping functionality, which was previously only 2013-09-21 21:03:52 +00:00
Makefile Compile reloc.o with -fno-jump-tables on MIPS. 2017-08-30 20:00:15 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
malloc.c libexec: minor spelling fixes in comments. 2016-05-01 19:39:23 +00:00
map_object.c Use address space guard to implement inter-segment gap. 2017-06-24 17:04:27 +00:00
paths.h Convert casperd(8) daemon to the libcasper. 2016-02-25 18:23:40 +00:00
rtld_lock.c Fix acquisition of nested write compat rtld locks. 2017-01-10 19:26:55 +00:00
rtld_lock.h Change compiler setting to make default visibility of the symbols for 2015-03-29 18:53:21 +00:00
rtld_printf.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
rtld_printf.h Add the LD_LIBRARY_PATH_FDS environmental variable. 2014-06-20 17:08:32 +00:00
rtld_tls.h Change compiler setting to make default visibility of the symbols for 2015-03-29 18:53:21 +00:00
rtld_utrace.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
rtld.1 Add serial comma. 2017-09-01 16:56:37 +00:00
rtld.c Remove unneeded calls to access(2) from rtld(1); just call open(2) instead. 2017-10-24 12:56:08 +00:00
rtld.h Handle relocations for newer non-PIC MIPS ABI. 2017-09-12 17:46:30 +00:00
Symbol.map Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
xmalloc.c Increase alignment to size of pointer if the alignment is too small. 2014-02-22 11:06:48 +00:00