Commit e863d920 authored by Matt Caswell's avatar Matt Caswell
Browse files

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: default avatarRichard Levitte <levitte@openssl.org>
parent ea09088e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -82,6 +82,8 @@ tags
TAGS
cscope.out
*.d
crypto.map
ssl.map

# Windows
/tmp32
+12 −1
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
        goto err;
    (void)BIO_flush(out);

#ifdef OPENSSL_SYS_WIN32
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_LINUX)
    message(out, "Probable prime generation with coprimes disabled");
#else
    message(out, "Probable prime generation with coprimes");
@@ -1859,7 +1859,8 @@ int test_small_prime(BIO *bp, BN_CTX *ctx)
    return ret;
}

#ifndef OPENSSL_SYS_WIN32
/* We can't test this on platforms where local symbols aren't exported */
#if !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_LINUX)
int test_probable_prime_coprime(BIO *bp, BN_CTX *ctx)
{
    int i, j, ret = 0;
+3 −3
Original line number Diff line number Diff line
@@ -75,17 +75,17 @@ sub testordinals
    while (my $line = <$fh>) {
        my @tokens = split(/(?:\s+|\s*:\s*)/, $line);
        #Check the line looks sane
        if ($#tokens < 4 || $#tokens > 5) {
        if ($#tokens < 5 || $#tokens > 6) {
            print STDERR "Invalid line:\n$line\n";
            $ret = 0;
            last;
        }
        if ($tokens[2] eq "NOEXIST") {
        if ($tokens[3] eq "NOEXIST") {
            #Ignore this line
            next;
        }
        #Some ordinals can be repeated, e.g. if one is VMS and another is !VMS
        $newqual = $tokens[3];
        $newqual = $tokens[4];
        $newqual =~ s/!//g;
        if ($cnt > $tokens[1]
                || ($cnt == $tokens[1] && ($qualifier ne $newqual
+4741 −4741

File changed.

Preview size limit exceeded, changes collapsed.

Loading