* include/link.h: Include sysd-link.h.
* sysdeps/generic/sysd-link.h: New file.
* sysdeps/unix/sysv/linux/sysd-link.h: New file.
* elf/Makefile (distribute): Add sysd-link.h.
* elf/dl-load.c: Use definitions from sysd-link.h instead of stat
types and functions directly.
* elf/dl-misc.c: Likewise.
* elf/dl-profile.c: Likewise.
* elf/loadfail.c (main): Close all successfully loaded objects.
* elf/Makefile (tests): Add loadfail.
Add rules to build failobj.so.
* elf/loadfail.c: New file. Test of failing to load object with
RTLD_GLOBAL set.
* elf/failobj.c: New file. Object which will fail to load.