Linux: Add version script to restrict exported symbols (issue #1765)

This commit is contained in:
Marshall Greenblatt 2016-06-06 12:26:55 -04:00
parent b4e81659a4
commit b1517ab47d
6 changed files with 21 additions and 4 deletions

View File

@ -2090,6 +2090,14 @@
},
},
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'link_settings': {
'ldflags': [
# Only export necessary symbols from libcef.so.
'-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/cef/libcef_dll/libcef.lst',
],
},
}],
],
}],
}], # OS!="mac"

View File

@ -279,7 +279,7 @@ CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
// Creates a new context object that shares storage with |other| and uses an
// optional |handler|.
///
CEF_EXPORT cef_request_context_t* create_context_shared(
CEF_EXPORT cef_request_context_t* cef_create_context_shared(
cef_request_context_t* other,
struct _cef_request_context_handler_t* handler);

View File

@ -104,7 +104,7 @@ class CefRequestContext : public virtual CefBase {
// Creates a new context object that shares storage with |other| and uses an
// optional |handler|.
///
/*--cef(capi_name=create_context_shared,optional_param=handler)--*/
/*--cef(capi_name=cef_create_context_shared,optional_param=handler)--*/
static CefRefPtr<CefRequestContext> CreateContext(
CefRefPtr<CefRequestContext> other,
CefRefPtr<CefRequestContextHandler> handler);

View File

@ -58,7 +58,7 @@ CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
return CefRequestContextCppToC::Wrap(_retval);
}
CEF_EXPORT cef_request_context_t* create_context_shared(
CEF_EXPORT cef_request_context_t* cef_create_context_shared(
cef_request_context_t* other,
struct _cef_request_context_handler_t* handler) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -61,7 +61,7 @@ CefRefPtr<CefRequestContext> CefRequestContext::CreateContext(
// Unverified params: handler
// Execute
cef_request_context_t* _retval = create_context_shared(
cef_request_context_t* _retval = cef_create_context_shared(
CefRequestContextCToCpp::Unwrap(other),
CefRequestContextHandlerCppToC::Wrap(handler));

9
libcef_dll/libcef.lst Normal file
View File

@ -0,0 +1,9 @@
# Copyright 2016 The Chromium Embedded Framework Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
/* Only export necessary symbols from libcef.so. */
global: cef_*;
local: *;
};