Skip to content

Commit

Permalink
fix: do not override symbols in userland eBPF programs with symbols p…
Browse files Browse the repository at this point in the history
…rovided by bpftime's bundled libbpf (#305)

* update

* update
  • Loading branch information
Officeyutong authored Jun 20, 2024
1 parent b4e37a2 commit fb8402f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion runtime/agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ add_library(bpftime-agent SHARED
agent.cpp
)
add_dependencies(bpftime-agent FridaGum spdlog::spdlog bpftime_frida_uprobe_attach_impl bpftime_syscall_trace_attach_impl)
set_property(TARGET bpftime-agent PROPERTY CXX_STANDARD 20)
set_target_properties(bpftime-agent PROPERTIES CXX_STANDARD 20 LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/agent.version)
target_link_options(bpftime-agent PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/agent.version)
target_include_directories(bpftime-agent
PRIVATE
${FRIDA_GUM_INSTALL_DIR}
Expand Down
4 changes: 4 additions & 0 deletions runtime/agent/agent.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
global: injected_with_frida; bpftime_hooked_main; __libc_start_main; bpftime_agent_main; syscall_callback; _bpftime__setup_syscall_trace_callback;
local: *;
};
4 changes: 2 additions & 2 deletions runtime/syscall-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ target_include_directories(bpftime-syscall-server
"../../third_party/libbpf/include/uapi"
${SPDLOG_INCLUDE}
)
set_property(TARGET bpftime-syscall-server PROPERTY CXX_STANDARD 20)

set_target_properties(bpftime-syscall-server PROPERTIES CXX_STANDARD 20 LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/syscall-server.version)
target_link_options(bpftime-syscall-server PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/syscall-server.version)
if(${ENABLE_EBPF_VERIFIER})
add_dependencies(bpftime-syscall-server bpftime-verifier)
target_link_libraries(bpftime-syscall-server PRIVATE bpftime-verifier)
Expand Down
4 changes: 4 additions & 0 deletions runtime/syscall-server/syscall-server.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
global: epoll_wait; epoll_ctl; epoll_create1; ioctl; mmap64; mmap; close; syscall; munmap;
local: *;
};

0 comments on commit fb8402f

Please sign in to comment.