summaryrefslogtreecommitdiffstats
path: root/lib/csu
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-03-13 01:35:44 +0000
committerjdp <jdp@FreeBSD.org>1999-03-13 01:35:44 +0000
commitd790b6b7494e98c4e40be6154c20834d6c8e95ac (patch)
treeeef6882b9a4ae18db0fb6f91fa34868e4a98cb43 /lib/csu
parent2b06f8a3b7a570745797f9e2feb0a2a113badcec (diff)
downloadFreeBSD-src-d790b6b7494e98c4e40be6154c20834d6c8e95ac.zip
FreeBSD-src-d790b6b7494e98c4e40be6154c20834d6c8e95ac.tar.gz
Reverse the order of processing object files within an executable or
shared library when invoking global constructors and destructors. For constructors, the object files used to be processed from first to last; now they're done from last to first. (Destructors are done in the opposite order, as required by the C++ standard.) This makes us consistent with standard gcc and egcs compilers. It also eliminates ordering differences between dynamic and static executables. Bump the value of __FreeBSD_version to 400002 to reflect this change.
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/common/crtbegin.c6
-rw-r--r--lib/csu/i386-elf/crtbegin.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c
index 2e06dc8..ddc8b80 100644
--- a/lib/csu/common/crtbegin.c
+++ b/lib/csu/common/crtbegin.c
@@ -22,7 +22,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: crtbegin.c,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $
+ * $Id: crtbegin.c,v 1.2 1999/03/12 17:33:27 jdp Exp $
*/
#include <sys/cdefs.h>
@@ -41,6 +41,8 @@ do_ctors(void)
fptr *fpp;
for(fpp = ctor_list + 1; *fpp != 0; ++fpp)
+ ;
+ while(--fpp > ctor_list)
(**fpp)();
}
@@ -50,8 +52,6 @@ do_dtors(void)
fptr *fpp;
for(fpp = dtor_list + 1; *fpp != 0; ++fpp)
- ;
- while(--fpp > dtor_list)
(**fpp)();
}
diff --git a/lib/csu/i386-elf/crtbegin.c b/lib/csu/i386-elf/crtbegin.c
index 2e06dc8..ddc8b80 100644
--- a/lib/csu/i386-elf/crtbegin.c
+++ b/lib/csu/i386-elf/crtbegin.c
@@ -22,7 +22,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: crtbegin.c,v 1.1.1.1 1998/03/07 20:27:10 jdp Exp $
+ * $Id: crtbegin.c,v 1.2 1999/03/12 17:33:27 jdp Exp $
*/
#include <sys/cdefs.h>
@@ -41,6 +41,8 @@ do_ctors(void)
fptr *fpp;
for(fpp = ctor_list + 1; *fpp != 0; ++fpp)
+ ;
+ while(--fpp > ctor_list)
(**fpp)();
}
@@ -50,8 +52,6 @@ do_dtors(void)
fptr *fpp;
for(fpp = dtor_list + 1; *fpp != 0; ++fpp)
- ;
- while(--fpp > dtor_list)
(**fpp)();
}
OpenPOWER on IntegriCloud