Skip to content

Commit c46daa3

Browse files
r1violletgleocadie
andauthored
[Profiling] Reduce available symbols (#5195)
* Profiling - Reduce available symbols Add a linker script to define what symbols should be published * Fix * Make sure the native loader can load us --------- Co-authored-by: Gregory LEOCADIE <[email protected]>
1 parent 08c9c4c commit c46daa3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,16 @@ add_dependencies(${PROFILER_STATIC_LIB_NAME} libdatadog-lib libunwind-lib corecl
129129
# ******************************************************
130130
# Define shared target
131131
# ******************************************************
132+
set(dd_profiling_linker_script "${CMAKE_CURRENT_SOURCE_DIR}/datadog_profiling.version")
132133

133134
add_library(${PROFILER_SHARED_LIB_NAME} SHARED
134135
../Datadog.Profiler.Native/DllMain.cpp
135136
)
136137

137138
set_target_properties(${PROFILER_SHARED_LIB_NAME} PROPERTIES PREFIX "")
139+
set_target_properties(${PROFILER_SHARED_LIB_NAME} PROPERTIES LINK_DEPENDS "${dd_profiling_linker_script}")
140+
target_link_options(${PROFILER_SHARED_LIB_NAME} PRIVATE
141+
"LINKER:--version-script=${dd_profiling_linker_script}")
138142

139143
# Define linker libraries
140144
target_link_libraries(${PROFILER_SHARED_LIB_NAME}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
global: GetNativeProfilerIsReadyPtr; GetPointerToNativeTraceContext; Profiler_Version; SetApplicationInfoForAppDomain; SetEndpointForTrace; SetGitMetadataForApplication; ThreadsCpuManager_Map; DllGetClassObject; DllCanUnloadNow;
3+
local: *;
4+
};

0 commit comments

Comments
 (0)