[Midnightbsd-cvs] src: sys/sys: Introduce support for preinit, init and fini arrays per

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Feb 12 16:14:25 EST 2012


Log Message:
-----------
Introduce support for preinit, init and fini arrays per the ELF standard.

This patch is based on work by John Marino for DragonFly.  This makes us the second BSD to support this feature.

>From his comments:

For the main executable file, the .init_array and .fini_array sections
are handled by crt1, just like .init and .fini are.  In the case of
a statically linked binary, the .preinit_array section is also handled
by crt1.  The real-time linker handles the .init_array and .fini_array
sections for dynamically shared objects (libraries) and .preinit_array
for dynamically-linked binaries.  There are no .preinit_array sections
in the DSOs per standard.

These sections are described by the System V Application Binary Interface
http://www.sco.com/developers/gabi/latest/ch4.sheader.html#special_sections


In order for this patch to work, we also introduced several items from NetBSD needed for newer versions of GCC as well as some features used in this patch. (cdefs.h)

Finally, we're also through in manpages for cpu set which is totally unrelated, but an obmission from a previous patch for ULE.

Modified Files:
--------------
    src/lib/csu/amd64:
        crt1.c (r1.3 -> r1.4)
        (http://cvsweb.midnightbsd.org/src/lib/csu/amd64/crt1.c?r1=1.3&r2=1.4)
    src/lib/csu/i386-elf:
        crt1_c.c (r1.1 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/csu/i386-elf/crt1_c.c?r1=1.1&r2=1.2)
    src/lib/csu/sparc64:
        crt1.c (r1.3 -> r1.4)
        (http://cvsweb.midnightbsd.org/src/lib/csu/sparc64/crt1.c?r1=1.3&r2=1.4)
    src/lib/libc/sys:
        Makefile.inc (r1.4 -> r1.5)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/Makefile.inc?r1=1.4&r2=1.5)
        ftruncate.c (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/ftruncate.c?r1=1.1.1.2&r2=1.2)
        lseek.c (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/lseek.c?r1=1.1.1.2&r2=1.2)
        mmap.c (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/mmap.c?r1=1.1.1.2&r2=1.2)
        pread.c (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/pread.c?r1=1.1.1.2&r2=1.2)
        pwrite.c (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/pwrite.c?r1=1.1.1.2&r2=1.2)
        truncate.c (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/truncate.c?r1=1.1.1.2&r2=1.2)
    src/libexec/rtld-elf:
        rtld.c (r1.6 -> r1.7)
        (http://cvsweb.midnightbsd.org/src/libexec/rtld-elf/rtld.c?r1=1.6&r2=1.7)
        rtld.h (r1.1.1.3 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/libexec/rtld-elf/rtld.h?r1=1.1.1.3&r2=1.2)
    src/libexec/rtld-elf/amd64:
        rtld_machdep.h (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/libexec/rtld-elf/amd64/rtld_machdep.h?r1=1.1.1.2&r2=1.2)
    src/libexec/rtld-elf/i386:
        rtld_machdep.h (r1.1.1.2 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/libexec/rtld-elf/i386/rtld_machdep.h?r1=1.1.1.2&r2=1.2)
    src/libexec/rtld-elf/sparc64:
        rtld_machdep.h (r1.1.1.1 -> r1.2)
        (http://cvsweb.midnightbsd.org/src/libexec/rtld-elf/sparc64/rtld_machdep.h?r1=1.1.1.1&r2=1.2)
    src/sys/sys:
        cdefs.h (r1.6 -> r1.7)
        (http://cvsweb.midnightbsd.org/src/sys/sys/cdefs.h?r1=1.6&r2=1.7)

Added Files:
-----------
    src/lib/libc/sys:
        cpuset.2 (r1.1)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/cpuset.2?rev=1.1&content-type=text/x-cvsweb-markup)
        cpuset_getaffinity.2 (r1.1)
        (http://cvsweb.midnightbsd.org/src/lib/libc/sys/cpuset_getaffinity.2?rev=1.1&content-type=text/x-cvsweb-markup)


More information about the Midnightbsd-cvs mailing list