summaryrefslogtreecommitdiff
path: root/libgcc/config/rs6000
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-23 15:38:07 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-23 15:38:07 +0000
commit39da74401a8eb9031a8d1e0e3556d0a47964e04f (patch)
treef4b1af998497b3580f1c29d4a76412a5adc04585 /libgcc/config/rs6000
parenta560d2397eb3c122f86103825920adc5aa1f5289 (diff)
downloadgcc-39da74401a8eb9031a8d1e0e3556d0a47964e04f.tar.gz
libgcc:
PR target/33704 * config/rs6000/aixinitfini.c: New file. * config/rs6000/t-aix-cxa (LIB2ADD_ST): Add aixinitfini.c. * config/rs6000/libgcc-aix-cxa.ver (GCC_4.9): Add libgcc initfini symbols. gcc: PR target/33704 * config/rs6000/aix.h (COLLECT_SHARED_INIT_FUNC): Define. (COLLECT_SHARED_FINI_FUNC): Define. * collect2.c (aix_shared_initname): Declare. (aix_shared_fininame): Declare. (symkind): Add SYM_AIXI and SYM_AIXD. (scanfilter_masks): Add SCAN_AIXI and SCAN_AIXD. (struct names special): Add GLOBAL__AIXI_ and GLOBAL__AIXD_. (aixlazy_flag): Parse. (extract_init_priority): SYM_AIXI and SYM_AIXD have highest priority. (scan_prog_file, COFF): Handle SYM_AIXI and SYM_AIXD. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205309 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/rs6000')
-rw-r--r--libgcc/config/rs6000/aixinitfini.c33
-rw-r--r--libgcc/config/rs6000/libgcc-aix-cxa.ver5
-rw-r--r--libgcc/config/rs6000/t-aix-cxa2
3 files changed, 40 insertions, 0 deletions
diff --git a/libgcc/config/rs6000/aixinitfini.c b/libgcc/config/rs6000/aixinitfini.c
new file mode 100644
index 00000000000..e95575820e2
--- /dev/null
+++ b/libgcc/config/rs6000/aixinitfini.c
@@ -0,0 +1,33 @@
+/* FIXME: rename this file */
+
+/*
+ Artificially create _GLOBAL_AIX[ID]_shr_o symbols in libgcc.a.
+
+ This means that libstdc++.a can invoke these symbols and they are resolved
+ regardless of whether libstdc++.a is linked against libgcc_s.a or libgcc.a.
+
+ The symbols are created in libgcc_s.a by collect2 as there are exception
+ frames to register for LIB2_DIVMOD_FUNCS.
+
+ The symbols are NOT created by collect2 for libgcc.a, because libgcc.a is
+ a 'real' archive containing objects and collect2 is not invoked.
+
+ libstdc++.a is linked against libgcc.a when handling the command line
+ options '-static-libgcc -static-libstdc++'.
+*/
+
+void _GLOBAL__AIXI_shr_o (void);
+void _GLOBAL__AIXD_shr_o (void);
+
+void
+_GLOBAL__AIXI_shr_o (void)
+{
+ return;
+}
+
+void
+_GLOBAL__AIXD_shr_o (void)
+{
+ return;
+}
+
diff --git a/libgcc/config/rs6000/libgcc-aix-cxa.ver b/libgcc/config/rs6000/libgcc-aix-cxa.ver
index 083067d141b..f89df2312a3 100644
--- a/libgcc/config/rs6000/libgcc-aix-cxa.ver
+++ b/libgcc/config/rs6000/libgcc-aix-cxa.ver
@@ -2,3 +2,8 @@ GCC_4.8 {
__cxa_atexit
__cxa_finalize
}
+
+GCC_4.9 {
+ _GLOBAL__AIXI_shr_o
+ _GLOBAL__AIXD_shr_o
+}
diff --git a/libgcc/config/rs6000/t-aix-cxa b/libgcc/config/rs6000/t-aix-cxa
index 4ef818558a7..4755c20c964 100644
--- a/libgcc/config/rs6000/t-aix-cxa
+++ b/libgcc/config/rs6000/t-aix-cxa
@@ -1,6 +1,8 @@
LIB2ADDEH += $(srcdir)/config/rs6000/cxa_atexit.c \
$(srcdir)/config/rs6000/cxa_finalize.c
+LIB2ADD_ST += $(srcdir)/config/rs6000/aixinitfini.c
+
SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-aix-cxa.ver
crtcxa.o: $(srcdir)/config/rs6000/crtcxa.c