git: crtstuff: Stop calling _init/_fini methods on dyn binaries

John Marino marino at
Sat Mar 17 19:19:30 PDT 2012

commit e2d7e866df9b768db493bf358a0ccc59efd60621
Author: John Marino <draco at>
Date:   Sat Mar 17 20:05:10 2012 +0100

    crtstuff: Stop calling _init/_fini methods on dyn binaries
    The runtime linker has already been modified to add the ability to call
    _init and _fini methods on the main executable.  Previously it would
    only do this for shared libraries.
    A new ELF note with value 0x20 is added to signify that the crt code
    no longer calls these methods so that rtld will know that it needs
    to do it.  The name of the note section has been changed from
    .note.ABI-tag to .note.tag.  There was an option to put the two notes
    each in their own section, or put both notes in the same section.  The
    latter was selected.  Since the second note is not an ABI-tag, the
    section was simply renamed.  This doesn't cause any issues.
    Taken from: FreeBSD SVN 232832 (2012-03-11)

Summary of changes:
 lib/csu/Makefile          |    2 +-
 lib/csu/common/initfini.c |   57 +++++++++++++++++++++++++++++++++++++++++++++
 lib/csu/common/notes.h    |    2 +-
 lib/csu/i386/crt1_c.c     |   33 +++-----------------------
 lib/csu/x86_64/crt1.c     |   36 ++--------------------------
 5 files changed, 66 insertions(+), 64 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list