crtstuff: Stop calling _init/_fini methods on dyn binaries
authorJohn Marino <draco@marino.st>
Sat, 17 Mar 2012 19:05:10 +0000 (20:05 +0100)
committerJohn Marino <draco@marino.st>
Sun, 18 Mar 2012 02:12:04 +0000 (03:12 +0100)
commite2d7e866df9b768db493bf358a0ccc59efd60621
tree551589340efa810e41a19b8bcd2479d9b28f4aaa
parent7f5c8f9721216c496b54eff209b96f6f5f6bd189
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)
lib/csu/Makefile
lib/csu/common/initfini.c
lib/csu/common/notes.h
lib/csu/i386/crt1_c.c
lib/csu/x86_64/crt1.c