Source-Changes-HG archive

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

[src/netbsd-6]: src Pull up following revision(s) (requested by martin in tic...



details:   https://anonhg.NetBSD.org/src/rev/95359dafc513
branches:  netbsd-6
changeset: 774427:95359dafc513
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Aug 13 17:09:49 2012 +0000

description:
Pull up following revision(s) (requested by martin in ticket #475):
        lib/csu/sparc_elf/Makefile: revision 1.7
        external/gpl3/gcc/dist/gcc/config/netbsd-elf.h: revision 1.4
        lib/csu/sparc64/Makefile: revision 1.9
        lib/csu/sparc_elf/crt0.c: revision 1.15
        lib/csu/sparc64/crt0.c: revision 1.27
Make this position independend (for -pie executables)
Slightly simplify and make position independend.
Part of fixing PR port-sparc64/46724.
pay attention to -pie: link crt{begin,end}S.o.
this fixes -fpie on sparc and sparc64, and probably others.

diffstat:

 external/gpl3/gcc/dist/gcc/config/netbsd-elf.h |  12 +++++++++---
 lib/csu/sparc64/Makefile                       |   4 ++--
 lib/csu/sparc64/crt0.c                         |  10 +++-------
 lib/csu/sparc_elf/Makefile                     |   4 ++--
 lib/csu/sparc_elf/crt0.c                       |   6 +++---
 5 files changed, 19 insertions(+), 17 deletions(-)

diffs (121 lines):

diff -r a37efae62470 -r 95359dafc513 external/gpl3/gcc/dist/gcc/config/netbsd-elf.h
--- a/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h    Sun Aug 12 19:27:59 2012 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h    Mon Aug 13 17:09:49 2012 +0000
@@ -52,8 +52,11 @@
        %{!p:crt0%O%s}}}                \
    %:if-exists(crti%O%s)       \
    %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
-   %{!static: \
-     %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}"
+   %{!static:                   \
+     %{!shared:                 \
+       %{!pie:crtbegin%O%s}     \
+       %{pie:crtbeginS%O%s}}    \
+     %{shared:crtbeginS%O%s}}"
 
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
@@ -64,7 +67,10 @@
    C++ file-scope static objects deconstructed after exiting "main".  */
 
 #define NETBSD_ENDFILE_SPEC    \
-  "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
+  "%{!shared:                   \
+    %{!pie:crtend%O%s}          \
+    %{pie:crtendS%O%s}}         \
+   %{shared:crtendS%O%s}        \
    %:if-exists(crtn%O%s)"
 
 #undef ENDFILE_SPEC
diff -r a37efae62470 -r 95359dafc513 lib/csu/sparc64/Makefile
--- a/lib/csu/sparc64/Makefile  Sun Aug 12 19:27:59 2012 +0000
+++ b/lib/csu/sparc64/Makefile  Mon Aug 13 17:09:49 2012 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile,v 1.8 2011/07/16 23:07:50 mrg Exp $
+#      $NetBSD: Makefile,v 1.8.4.1 2012/08/13 17:09:49 riz Exp $
 
-#Uncomment the next line to enable the new .init fallthru
 CPPFLAGS+=     -I${.CURDIR}/../sparc_elf
+CFLAGS+=       -fPIC
 
 ELFSIZE=64
 
diff -r a37efae62470 -r 95359dafc513 lib/csu/sparc64/crt0.c
--- a/lib/csu/sparc64/crt0.c    Sun Aug 12 19:27:59 2012 +0000
+++ b/lib/csu/sparc64/crt0.c    Mon Aug 13 17:09:49 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.26 2011/03/07 05:09:11 joerg Exp $ */
+/* $NetBSD: crt0.c,v 1.26.6.1 2012/08/13 17:09:50 riz Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -45,8 +45,6 @@
  */
 
 __asm("\n\
-       .data\n\
-__data_start:                                  ! Start of data section\n\
        .text\n\
        .align 4\n\
        .global _start\n\
@@ -55,11 +53,9 @@
        .register %g2,#scratch\n\
 _start:\n\
 __start:\n\
-       setx    __data_start, %o0, %g4          ! Point %g4 to start of data section\n\
-       clr     %g4                             ! egcs thinks this is zero. XXX\n\
+       clr     %g4                             ! XXX depends on memory model used \n\
        clr     %fp\n\
        add     %sp, 8*16 + 0x7ff, %o0          ! start of stack\n\
-       mov     %g1, %o1                        ! Cleanup routine\n\
        mov     %g3, %o1                        ! XXXX our rtld uses %g3\n\
        mov     %g2, %o2                        ! XXXX obj from rtld.\n\
        ba,pt   %icc, ___start                  ! XXXX jump over the retl egcs 2.96 inserts\n\
@@ -115,7 +111,7 @@
  * NOTE: Leave the RCS ID _after_ _start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.26 2011/03/07 05:09:11 joerg Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.26.6.1 2012/08/13 17:09:50 riz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"
diff -r a37efae62470 -r 95359dafc513 lib/csu/sparc_elf/Makefile
--- a/lib/csu/sparc_elf/Makefile        Sun Aug 12 19:27:59 2012 +0000
+++ b/lib/csu/sparc_elf/Makefile        Mon Aug 13 17:09:49 2012 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.6 2006/05/19 19:11:12 christos Exp $
+#      $NetBSD: Makefile,v 1.6.44.1 2012/08/13 17:09:49 riz Exp $
 
-#Uncomment the next line to enable the new .init fallthru
 CPPFLAGS+=     -I${.CURDIR}
+CFLAGS+=       -fPIC
 
 .include "${.CURDIR}/../common_elf/Makefile.inc"
diff -r a37efae62470 -r 95359dafc513 lib/csu/sparc_elf/crt0.c
--- a/lib/csu/sparc_elf/crt0.c  Sun Aug 12 19:27:59 2012 +0000
+++ b/lib/csu/sparc_elf/crt0.c  Mon Aug 13 17:09:49 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.c,v 1.14 2011/03/07 05:09:11 joerg Exp $ */
+/* $NetBSD: crt0.c,v 1.14.6.1 2012/08/13 17:09:49 riz Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -56,7 +56,7 @@
        sub     %sp, 24, %sp            ! expand to standard stack frame size\n\
        mov     %g3, %o3\n\
        mov     %g2, %o4\n\
-       call    ___start\n\
+       ba      ___start\n\
         mov    %g1, %o5\n\
 ");
 
@@ -100,7 +100,7 @@
  * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.
  */
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.14 2011/03/07 05:09:11 joerg Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.14.6.1 2012/08/13 17:09:49 riz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "common.c"



Home | Main Index | Thread Index | Old Index