Source-Changes-HG archive

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

[src/trunk]: src/lib/csu/common Make older GCC and Clang happy and use weak r...



details:   https://anonhg.NetBSD.org/src/rev/0646953c0d35
branches:  trunk
changeset: 345675:0646953c0d35
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Jun 05 00:43:39 2016 +0000

description:
Make older GCC and Clang happy and use weak references to the elements,
not declared as arrays.

diffstat:

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

diffs (54 lines):

diff -r 21802f91c2c8 -r 0646953c0d35 lib/csu/common/crtbegin.c
--- a/lib/csu/common/crtbegin.c Sat Jun 04 22:17:14 2016 +0000
+++ b/lib/csu/common/crtbegin.c Sun Jun 05 00:43:39 2016 +0000
@@ -27,7 +27,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: crtbegin.c,v 1.10 2016/06/01 21:21:55 joerg Exp $");
+__RCSID("$NetBSD: crtbegin.c,v 1.11 2016/06/05 00:43:39 joerg Exp $");
 
 #include "crtbegin.h"
 
@@ -39,9 +39,9 @@
        __weak_reference(_Jv_RegisterClasses);
 
 #if !defined(HAVE_INITFINI_ARRAY)
-__weakref_visible const fptr_t __CTOR_LIST__start[]
+__weakref_visible const fptr_t __CTOR_LIST__start
     __weak_reference(__CTOR_LIST__);
-__weakref_visible const fptr_t __CTOR_LIST__end[]
+__weakref_visible const fptr_t __CTOR_LIST__end
     __weak_reference(__CTOR_LIST_END__);
 
 __dso_hidden const fptr_t __aligned(sizeof(void *)) __CTOR_LIST__[] __section(".ctors") = {
@@ -95,7 +95,7 @@
                Jv_RegisterClasses(__JCR_LIST__);
 
 #if !defined(HAVE_INITFINI_ARRAY)
-       for (const fptr_t *p = __CTOR_LIST__end; p > __CTOR_LIST__start + 1; ) {
+       for (const fptr_t *p = &__CTOR_LIST__end; p > &__CTOR_LIST__start + 1; ) {
                (*(*--p))();
        }
 #endif
@@ -103,9 +103,9 @@
 
 #if !defined(__ARM_EABI__) || defined(SHARED) || defined(__ARM_DWARF_EH__)
 #if !defined(HAVE_INITFINI_ARRAY)
-__weakref_visible const fptr_t __DTOR_LIST__start[]
+__weakref_visible const fptr_t __DTOR_LIST__start
     __weak_reference(__DTOR_LIST__);
-__weakref_visible const fptr_t __DTOR_LIST__end[]
+__weakref_visible const fptr_t __DTOR_LIST__end
     __weak_reference(__DTOR_LIST_END__);
 
 __dso_hidden const fptr_t __aligned(sizeof(void *)) __DTOR_LIST__[] __section(".dtors") = {
@@ -132,7 +132,7 @@
 #endif
 
 #if !defined(HAVE_INITFINI_ARRAY)
-       for (const fptr_t *p = __DTOR_LIST__start + 1; p < __DTOR_LIST__end; ) {
+       for (const fptr_t *p = &__DTOR_LIST__start + 1; p < &__DTOR_LIST__end; ) {
                (*(*p++))();
        }
 #endif



Home | Main Index | Thread Index | Old Index