summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1996-02-20 04:07:26 +0000
committerjdp <jdp@FreeBSD.org>1996-02-20 04:07:26 +0000
commit4cf4be8b5a2cc28bfc387dd17edb8b6788cc5e58 (patch)
tree807df82ef40cdc5d47eb471b261d3100ed02fe1a /lib
parent0b83253216562ca9f5547699c565d93e3af31e0e (diff)
downloadFreeBSD-src-4cf4be8b5a2cc28bfc387dd17edb8b6788cc5e58.zip
FreeBSD-src-4cf4be8b5a2cc28bfc387dd17edb8b6788cc5e58.tar.gz
Changed the dimensions of __CTOR_LIST__ and __DTOR_LIST__ from 0
to 2. This makes them agree with the declarations in libgcc, and clears the way once again for linking c++rt0.o into all libraries, and eliminating CPLUSPLUSLIB from <bsd.lib.mk>. (I have not made that change yet, because there is still a bootstrapping problem for "make world".) Also, removed a check which ensured that the constructor count in the first word of __CTOR_LIST__ was greater than zero before traversing the list. I had added that check earlier, but it is no longer necessary, now that there is guaranteed to be at least 2 words in __CTOR_LIST__.
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/i386/c++rt0.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/csu/i386/c++rt0.c b/lib/csu/i386/c++rt0.c
index 40cc5fa..079c098 100644
--- a/lib/csu/i386/c++rt0.c
+++ b/lib/csu/i386/c++rt0.c
@@ -27,7 +27,7 @@
* (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: c++rt0.c,v 1.3 1995/06/27 09:53:24 dfr Exp $
+ * $Id: c++rt0.c,v 1.4 1996/01/15 17:53:25 jdp Exp $
*/
/*
@@ -38,8 +38,8 @@
* number of pointers in each.
* The tables are also null-terminated.
*/
-void (*__CTOR_LIST__[0])(void);
-void (*__DTOR_LIST__[0])(void);
+void (*__CTOR_LIST__[2])(void);
+void (*__DTOR_LIST__[2])(void);
static void
__dtors(void)
@@ -54,18 +54,10 @@ __dtors(void)
static void
__ctors(void)
{
- /*
- * If the shared library doesn't have any static constructors in it,
- * then __CTOR_LIST__ will come out as a simple COMMON region of
- * 4 bytes. That is why we have to check the count in the first
- * word.
- */
- if ((unsigned long) __CTOR_LIST__[0] > 0) {
- void (**p)(void) = __CTOR_LIST__ + 1;
+ void (**p)(void) = __CTOR_LIST__ + 1;
- while (*p)
- (**p++)();
- }
+ while (*p)
+ (**p++)();
}
extern void __init() asm(".init");
OpenPOWER on IntegriCloud