aboutsummaryrefslogtreecommitdiff
path: root/lib/csu/common/crtbegin.c
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1999-03-12 17:33:28 +0000
committerJohn Polstra <jdp@FreeBSD.org>1999-03-12 17:33:28 +0000
commitbb2b8691880a2f543630998294d05519d5523275 (patch)
treec94580d2cdeb7a61b7a11d34684e52fb2d2b22c2 /lib/csu/common/crtbegin.c
parent2f9a9cb08c618c057bda573fe3a678c939bc36f5 (diff)
downloadsrc-bb2b8691880a2f543630998294d05519d5523275.tar.gz
src-bb2b8691880a2f543630998294d05519d5523275.zip
Move the code for the ".init" and ".fini" sections outside of a
C function so the compiler won't try to emit line numbers for it with "-g", breaking the build. This has the nice side-effect of making crtbegin.o and crtbeginS.o a little bit smaller. Remove "-Wno-unused" from the Makefile. Replace it with "__unused" on particular function and variable declarations.
Notes
Notes: svn path=/head/; revision=44691
Diffstat (limited to 'lib/csu/common/crtbegin.c')
-rw-r--r--lib/csu/common/crtbegin.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c
index 9970d85196ba..2e06dc8ec846 100644
--- a/lib/csu/common/crtbegin.c
+++ b/lib/csu/common/crtbegin.c
@@ -22,14 +22,19 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: crtbegin.c,v 1.3 1996/04/12 02:24:35 jdp Exp $
+ * $Id: crtbegin.c,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $
*/
+#include <sys/cdefs.h>
+
typedef void (*fptr)(void);
static fptr ctor_list[1] __attribute__((section(".ctors"))) = { (fptr) -1 };
static fptr dtor_list[1] __attribute__((section(".dtors"))) = { (fptr) -1 };
+static void do_ctors(void) __unused;
+static void do_dtors(void) __unused;
+
static void
do_ctors(void)
{
@@ -50,12 +55,5 @@ do_dtors(void)
(**fpp)();
}
-static void
-function_skeleton(void)
-{
- __asm__(".section .init,\"ax\",@progbits");
- do_ctors();
- __asm__(".section .fini,\"ax\",@progbits");
- do_dtors();
- __asm__(".text");
-}
+__asm__(".section .init,\"ax\",@progbits; call do_ctors; .previous");
+__asm__(".section .fini,\"ax\",@progbits; call do_dtors; .previous");