diff options
author | Matt Caswell <matt@openssl.org> | 2015-12-14 09:22:58 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-12-15 16:46:48 +0000 |
commit | e863d92010f250164d0f90cb61e51e3d9429942a (patch) | |
tree | c8689ff6c2e165a3df90f96736ef87242872b024 /Makefile.shared | |
parent | ea09088e172dd0564ec5df64c56d1c402d3679a2 (diff) |
Don't export internal symbols
On Linux when creating the .so file we were exporting all symbols. We should
only be exporting public symbols. This commit fixes the issue. It is only
applicable to linux currently although the same technique may work for other
platforms (e.g. Solaris should work the same way).
This also adds symbol version information to our exported symbols.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'Makefile.shared')
-rw-r--r-- | Makefile.shared | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile.shared b/Makefile.shared index f5abd4069d..208382ef7d 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -170,6 +170,17 @@ link_a.gnu: link_app.gnu: @ $(DO_GNU_APP); $(LINK_APP) +link_a.linux-shared: + @if [ $(LIBNAME) != "crypto" -a $(LIBNAME) != "ssl" ]; then echo libname is $(LIBNAME); sleep 2; $(DO_GNU_SO); else \ + $(PERL) util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \ + $(CALC_VERSIONS); \ + SHLIB=lib$(LIBNAME).so; \ + SHLIB_SUFFIX=; \ + ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \ + fi; $(LINK_SO_A) + link_o.bsd: @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \ $(CALC_VERSIONS); \ @@ -566,7 +577,7 @@ symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath: # Compatibility targets link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu -link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu +link_a.bsd-gcc-shared link_a.gnu-shared: link_a.gnu link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu link_o.bsd-shared: link_o.bsd |