iovisor / iovisor/bcc

Libbcc_bpf.so should not export libstdc++ symbols

Open
#5,243 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

If libbcc_bpf.so is linked in a program that has another copy of libstdc++, then currently `std::` globals can be constructed with one set of libstdc++ symbols and destructed with another one that gets dlopen'ed later.

`src/cc/libbpf/src/Makefile` already contains this:
```
VERSION_SCRIPT := libbpf.map
libbpf.so: $(SHARED_OBJS)
$(Q)$(CC) -shared -Wl,--version-script=$(VERSION_SCRIPT) ...
```
And `src/cc/CMakeLists.txt` should probably also have something equivalent:
```
target_link_libraries(bpf-shared elf z)
+target_link_options(bpf-shared PRIVATE -Wl,-version-script=${CMAKE_CURRENT_SOURCE_DIR}/libbpf/src/libbpf.map)
if(LIBDEBUGINFOD_FOUND)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.