aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2014-12-17 02:01:10 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2014-12-17 02:01:10 +0000
commit69044fa9eb7eac6f9176861154b7e06125209671 (patch)
tree8bd18b664c7c0a406e93802ac90cf703c8df9bbc /libgcc
parentd8a99c7c6bce947706eeafbf69ec214845eb4a66 (diff)
downloadgcc-69044fa9eb7eac6f9176861154b7e06125209671.zip
gcc-69044fa9eb7eac6f9176861154b7e06125209671.tar.gz
gcc-69044fa9eb7eac6f9176861154b7e06125209671.tar.bz2
crt.h: New.
libgcc/ * config/sh/crt.h: New. * config/sh/crti.S: Use GLOBAL macro from crt.h for _init and _fini symbols. * config/sh/crt1.S: Likewise. From-SVN: r218807
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog7
-rw-r--r--libgcc/config/sh/crt.h29
-rw-r--r--libgcc/config/sh/crt1.S13
-rw-r--r--libgcc/config/sh/crti.S9
4 files changed, 47 insertions, 11 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 0ce1a7a..ea0057f 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-17 Oleg Endo <olegendo@gcc.gnu.org>
+
+ * config/sh/crt.h: New.
+ * config/sh/crti.S: Use GLOBAL macro from crt.h for _init and _fini
+ symbols.
+ * config/sh/crt1.S: Likewise.
+
2014-12-15 Uros Bizjak <ubizjak@gmail.com>
PR libgcc/63832
diff --git a/libgcc/config/sh/crt.h b/libgcc/config/sh/crt.h
new file mode 100644
index 0000000..1df4911
--- /dev/null
+++ b/libgcc/config/sh/crt.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3, or (at your option) any
+later version.
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef __USER_LABEL_PREFIX__
+#error __USER_LABEL_PREFIX__ not defined
+#endif
+
+#define CONCAT(a, b) CONCAT2(a, b)
+#define CONCAT2(a, b) a ## b
+
+#define GLOBAL(X) CONCAT(__USER_LABEL_PREFIX__,X)
diff --git a/libgcc/config/sh/crt1.S b/libgcc/config/sh/crt1.S
index d8b9295..b48a1a1 100644
--- a/libgcc/config/sh/crt1.S
+++ b/libgcc/config/sh/crt1.S
@@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+#include "crt.h"
#ifdef MMU_SUPPORT
/* Section used for exception/timer interrupt stack area */
@@ -420,7 +421,7 @@ start:
#endif /* MMU_SUPPORT */
pt/l .Lzero_bss_loop, tr0
- pt/l _init, tr5
+ pt/l GLOBAL(_init), tr5
pt/l ___setup_argv_and_call_main, tr6
pt/l _exit, tr7
@@ -452,7 +453,7 @@ start:
! arrange for exit to call fini
pt/l _atexit, tr1
- LOAD_ADDR (_fini, r2)
+ LOAD_ADDR (GLOBAL(_fini), r2)
blink tr1, r18
! call init
@@ -850,9 +851,9 @@ exit_k:
atexit_k:
.long _atexit
init_k:
- .long _init
+ .long GLOBAL(_init)
fini_k:
- .long _fini
+ .long GLOBAL(_fini)
#ifdef VBR_SETUP
old_vbr_k:
.long old_vbr
@@ -1116,9 +1117,7 @@ vbr_600:
#if defined(__SH_FPU_ANY__)
.balign 4
pervading_precision_k:
-#define CONCAT1(A,B) A##B
-#define CONCAT(A,B) CONCAT1(A,B)
- .long CONCAT(__USER_LABEL_PREFIX__,__fpscr_values)+4
+ .long GLOBAL(__fpscr_values)+4
#endif
#else
mov.l 2f, r0 ! Load the old vbr setting (if any).
diff --git a/libgcc/config/sh/crti.S b/libgcc/config/sh/crti.S
index 550f637..cacd514 100644
--- a/libgcc/config/sh/crti.S
+++ b/libgcc/config/sh/crti.S
@@ -22,6 +22,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+#include "crt.h"
/* The code in sections .init and .fini is supposed to be a single
regular function. The function in .init is called directly from
@@ -44,8 +45,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#else
.p2align 1
#endif
- .global _init
-_init:
+ .global GLOBAL(_init)
+GLOBAL(_init):
#if __SHMEDIA__
addi r15, -16, r15
st.q r15, 8, r14
@@ -89,8 +90,8 @@ _init:
#else
.p2align 1
#endif
- .global _fini
-_fini:
+ .global GLOBAL(_fini)
+GLOBAL(_fini):
#if __SHMEDIA__
addi r15, -16, r15
st.q r15, 8, r14