]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix PR lto/49664: liblto_plugin.so exports too many symbols
authorAndrew Pinski <apinski@marvell.com>
Sun, 12 Sep 2021 08:58:16 +0000 (08:58 +0000)
committerAndrew Pinski <apinski@marvell.com>
Mon, 13 Sep 2021 15:16:56 +0000 (15:16 +0000)
So right now liblto_plugin.so exports many libiberty symbols and
simple_object file symbols but really it just needs to export onload.

This fixes the problem by using "-export-symbols-regex onload" on
the libtool link line.

lto-plugin/ChangeLog:

PR lto/49664
* Makefile.am: Export only onload.
* Makefile.in: Regenerate.

lto-plugin/Makefile.am
lto-plugin/Makefile.in

index 8b20e1d1d87e2dda9f37763492ddf39a8022c48c..988d7a78294bb8fc2b600efe5d9bcf9725277fd2 100644 (file)
@@ -21,7 +21,8 @@ in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
 liblto_plugin_la_SOURCES = lto-plugin.c
 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
 liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
-       $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir)
+       $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
+       -export-symbols-regex onload
 # Can be simplified when libiberty becomes a normal convenience library.
 libiberty = $(with_libiberty)/libiberty.a
 libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
index 20611c6b1e6f5e381d4690e34ab7a69f2c827bb6..f8df31bb1e86f82254eeca67abd281b50b4467a5 100644 (file)
@@ -323,6 +323,7 @@ prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 real_target_noncanonical = @real_target_noncanonical@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -350,9 +351,9 @@ libexecsub_LTLIBRARIES = liblto_plugin.la
 in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
 liblto_plugin_la_SOURCES = lto-plugin.c
 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
-liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(lt_host_flags) -module -avoid-version \
-       -bindir $(libexecsubdir) $(if $(wildcard \
-       $(libiberty_noasan)),, $(if $(wildcard \
+liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(lt_host_flags) -module \
+       -avoid-version -bindir $(libexecsubdir) -export-symbols-regex \
+       onload $(if $(wildcard $(libiberty_noasan)),, $(if $(wildcard \
        $(libiberty_pic)),,-Wc,$(libiberty)))
 # Can be simplified when libiberty becomes a normal convenience library.
 libiberty = $(with_libiberty)/libiberty.a