aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-04-07 09:27:39 -0400
committerJason Merrill <jason@gcc.gnu.org>2014-04-07 09:27:39 -0400
commitda34ade5e6c93713fc9cb0b7b505afb06b01b95a (patch)
treed17894e439e7f9ac2af8c36361871939b0353bc5 /gcc
parent67649cb84c2bfbe77d870b3606e66b90288eb824 (diff)
downloadgcc-da34ade5e6c93713fc9cb0b7b505afb06b01b95a.zip
gcc-da34ade5e6c93713fc9cb0b7b505afb06b01b95a.tar.gz
gcc-da34ade5e6c93713fc9cb0b7b505afb06b01b95a.tar.bz2
re PR c++/60731 (dynamic library not getting reinitialized on multiple calls to dlopen())
PR c++/60731 * common.opt (-fno-gnu-unique): Add. * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it. From-SVN: r209186
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/config/elfos.h2
-rw-r--r--gcc/doc/invoke.texi15
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86c7d5a..d3cde1e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-04-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/60731
+ * common.opt (-fno-gnu-unique): Add.
+ * config/elfos.h (USE_GNU_UNIQUE_OBJECT): Check it.
+
2014-04-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* haifa-sched.c: Fix outdated function reference and minor
diff --git a/gcc/common.opt b/gcc/common.opt
index 62c72f0..2259f29 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1267,6 +1267,10 @@ fgnu-tm
Common Report Var(flag_tm)
Enable support for GNU transactional memory
+fgnu-unique
+Common Report Var(flag_gnu_unique) Init(1)
+Use STB_GNU_UNIQUE if supported by the assembler
+
floop-flatten
Common Ignore
Does nothing. Preserved for backward compatibility.
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 1fce701..c1d5553 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -287,7 +287,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Write the extra assembler code needed to declare an object properly. */
#ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
-#define USE_GNU_UNIQUE_OBJECT 1
+#define USE_GNU_UNIQUE_OBJECT flag_gnu_unique
#else
#define USE_GNU_UNIQUE_OBJECT 0
#endif
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 80a93e1..cfc6d98 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1070,6 +1070,7 @@ See S/390 and zSeries Options.
-ffixed-@var{reg} -fexceptions @gol
-fnon-call-exceptions -fdelete-dead-exceptions -funwind-tables @gol
-fasynchronous-unwind-tables @gol
+-fno-gnu-unique @gol
-finhibit-size-directive -finstrument-functions @gol
-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
@@ -22013,6 +22014,20 @@ Generate unwind table in DWARF 2 format, if supported by target machine. The
table is exact at each instruction boundary, so it can be used for stack
unwinding from asynchronous events (such as debugger or garbage collector).
+@item -fno-gnu-unique
+@opindex fno-gnu-unique
+On systems with recent GNU assembler and C library, the C++ compiler
+uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
+of template static data members and static local variables in inline
+functions are unique even in the presence of @code{RTLD_LOCAL}; this
+is necessary to avoid problems with a library used by two different
+@code{RTLD_LOCAL} plugins depending on a definition in one of them and
+therefore disagreeing with the other one about the binding of the
+symbol. But this causes @code{dlclose} to be ignored for affected
+DSOs; if your program relies on reinitialization of a DSO via
+@code{dlclose} and @code{dlopen}, you can use
+@option{-fno-gnu-unique}.
+
@item -fpcc-struct-return
@opindex fpcc-struct-return
Return ``short'' @code{struct} and @code{union} values in memory like