Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/csu/common Also make sure the __CTOR_LIST__ is just alig...



details:   https://anonhg.NetBSD.org/src/rev/58a2637d516e
branches:  trunk
changeset: 326451:58a2637d516e
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Jan 29 20:57:49 2014 +0000

description:
Also make sure the __CTOR_LIST__ is just aligned to a pointer boundary.
By default, mips N32 will aligned to a 64-bit boundary not 32-bit
which causes an extra NULL entry to be added.
Fix "segfault on exit" several people have noticed on mips N32,
caused by a jr to a NULL address.

diffstat:

 lib/csu/common/crtbegin.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 5bcbce56ceaa -r 58a2637d516e lib/csu/common/crtbegin.c
--- a/lib/csu/common/crtbegin.c Wed Jan 29 20:13:04 2014 +0000
+++ b/lib/csu/common/crtbegin.c Wed Jan 29 20:57:49 2014 +0000
@@ -27,7 +27,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: crtbegin.c,v 1.7 2013/12/11 06:55:24 matt Exp $");
+__RCSID("$NetBSD: crtbegin.c,v 1.8 2014/01/29 20:57:49 bouyer Exp $");
 
 #include "crtbegin.h"
 
@@ -98,7 +98,7 @@
 
 #if !defined(__ARM_EABI__) || defined(SHARED)
 #if !defined(HAVE_INITFINI_ARRAY)
-__dso_hidden const fptr_t __DTOR_LIST__[] __section(".dtors") = {
+__dso_hidden const fptr_t __aligned(sizeof(void *)) __DTOR_LIST__[] __section(".dtors") = {
        (fptr_t) -1,
 };
 __dso_hidden extern const fptr_t __DTOR_LIST_END__[];



Home | Main Index | Thread Index | Old Index