summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-03-12 17:33:28 +0000
committerjdp <jdp@FreeBSD.org>1999-03-12 17:33:28 +0000
commita83e4078893f3a284de67a4f2375e037a5684e04 (patch)
tree72b60f076341b21cc6a08dc849a040713c94dfcb
parent6eaebd4ffe6b53793c9bfc5a3bdf683e9f8c4cd1 (diff)
downloadFreeBSD-src-a83e4078893f3a284de67a4f2375e037a5684e04.zip
FreeBSD-src-a83e4078893f3a284de67a4f2375e037a5684e04.tar.gz
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.
-rw-r--r--lib/csu/amd64/Makefile4
-rw-r--r--lib/csu/common/crtbegin.c18
-rw-r--r--lib/csu/common/crtend.c8
-rw-r--r--lib/csu/i386-elf/Makefile4
-rw-r--r--lib/csu/i386-elf/crtbegin.c18
-rw-r--r--lib/csu/i386-elf/crtend.c8
6 files changed, 30 insertions, 30 deletions
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile
index ae195e8..4d833aa 100644
--- a/lib/csu/amd64/Makefile
+++ b/lib/csu/amd64/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.2 1998/09/07 23:31:59 jdp Exp $
+# $Id: Makefile,v 1.3 1999/01/09 21:50:56 jdp Exp $
#
SRCS= crt1.c crtbegin.c crtend.c crti.S crtn.S
@@ -7,7 +7,7 @@ OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= gcrt1.o
SOBJS= crtbegin.So crtend.So
CFLAGS+= -elf
-CFLAGS+= -Wall -Wno-unused
+CFLAGS+= -Wall
LDFLAGS+= -elf
NOMAN= true
NOPIC= true
diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c
index 9970d85..2e06dc8 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");
diff --git a/lib/csu/common/crtend.c b/lib/csu/common/crtend.c
index e1f2293..e681cd2 100644
--- a/lib/csu/common/crtend.c
+++ b/lib/csu/common/crtend.c
@@ -22,10 +22,12 @@
* (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: crtend.c,v 1.3 1996/04/12 02:24:36 jdp Exp $
+ * $Id: crtend.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_end[1] __attribute__((section(".ctors"))) = { 0 };
-static fptr dtor_end[1] __attribute__((section(".dtors"))) = { 0 };
+static fptr ctor_end[1] __attribute__((section(".ctors"))) __unused = { 0 };
+static fptr dtor_end[1] __attribute__((section(".dtors"))) __unused = { 0 };
diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile
index ae195e8..4d833aa 100644
--- a/lib/csu/i386-elf/Makefile
+++ b/lib/csu/i386-elf/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.2 1998/09/07 23:31:59 jdp Exp $
+# $Id: Makefile,v 1.3 1999/01/09 21:50:56 jdp Exp $
#
SRCS= crt1.c crtbegin.c crtend.c crti.S crtn.S
@@ -7,7 +7,7 @@ OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= gcrt1.o
SOBJS= crtbegin.So crtend.So
CFLAGS+= -elf
-CFLAGS+= -Wall -Wno-unused
+CFLAGS+= -Wall
LDFLAGS+= -elf
NOMAN= true
NOPIC= true
diff --git a/lib/csu/i386-elf/crtbegin.c b/lib/csu/i386-elf/crtbegin.c
index 9970d85..2e06dc8 100644
--- a/lib/csu/i386-elf/crtbegin.c
+++ b/lib/csu/i386-elf/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");
diff --git a/lib/csu/i386-elf/crtend.c b/lib/csu/i386-elf/crtend.c
index e1f2293..e681cd2 100644
--- a/lib/csu/i386-elf/crtend.c
+++ b/lib/csu/i386-elf/crtend.c
@@ -22,10 +22,12 @@
* (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: crtend.c,v 1.3 1996/04/12 02:24:36 jdp Exp $
+ * $Id: crtend.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_end[1] __attribute__((section(".ctors"))) = { 0 };
-static fptr dtor_end[1] __attribute__((section(".dtors"))) = { 0 };
+static fptr ctor_end[1] __attribute__((section(".ctors"))) __unused = { 0 };
+static fptr dtor_end[1] __attribute__((section(".dtors"))) __unused = { 0 };
OpenPOWER on IntegriCloud