Subject: CVS commit: basesrc
To: None <source-changes@netbsd.org>
From: Ross Harvey <ross@netbsd.org>
List: source-changes
Date: 05/12/2001 01:44:15
Module Name:	basesrc
Committed By:	ross
Date:		Fri May 11 22:44:15 UTC 2001

Modified Files:
	basesrc/lib/csu/alpha: Makefile
	basesrc/lib/csu/common_elf: crtbegin.c crtend.c
	basesrc/lib/csu/i386_elf: Makefile
Added Files:
	basesrc/lib/csu/alpha: dot_init.h
	basesrc/lib/csu/common_elf: dot_init.h
	basesrc/lib/csu/i386_elf: dot_init.h

Log Message:
Reorganization of crtbegin/crtend.
o  Primary mod: alpha and i386 code for .init and .fini section fallthroughs
o  Actual fallthru is not yet enabled, see csu/{alpha,i386_elf}/Makefile
o  When enabled, should fix bin/12865 & should fix at least one WINE bug,
   see http://www.winehq.com/hypermail/wine-devel/2001/05/0021.html
o  Also, removed the function pointer hack put in to prevent gcc from
   incorrectly attempting to do short calls over section boundaries,
   on some architectures, rather, simply simply move ctors() and dtors()
   into .init and .fini.
Other notes.
o  Our crtbegin.c and crtend.c were completely in C, despite
   the fact that .init and .fini section fallthroughs require machine code.
   These modules implement the gnu ctors/dtors mechanism directly, eliminating
   in part the need for the elf .init/.fini section fallthrough. However,
   if we ever want to use the gnu-provided constructor support, we need to
   do the fallthrough, at least one program (WINE) apparently uses the
   feature independently, and other compilers may depend on the mechanism.
o  It is amusing that the previous NetBSD _init() and _fini() were put
   into the .init and .fini sections, because nothing is gained over
   plain .text if they don't fall through. Cargo cult!
o  Other elf ports will need to copy the alpha and i386 example mods.


To generate a diff of this commit:
cvs rdiff -r1.19 -r1.20 basesrc/lib/csu/alpha/Makefile
cvs rdiff -r0 -r1.1 basesrc/lib/csu/alpha/dot_init.h
cvs rdiff -r1.10 -r1.11 basesrc/lib/csu/common_elf/crtbegin.c
cvs rdiff -r1.6 -r1.7 basesrc/lib/csu/common_elf/crtend.c
cvs rdiff -r0 -r1.1 basesrc/lib/csu/common_elf/dot_init.h
cvs rdiff -r1.4 -r1.5 basesrc/lib/csu/i386_elf/Makefile
cvs rdiff -r0 -r1.1 basesrc/lib/csu/i386_elf/dot_init.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.