Skip to content

Commit b3ce66c

Browse files
committed
Remove asan from solib loader, do not export entrypoint
1 parent 83c3f82 commit b3ce66c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ddtrace.sym

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ ddog_sidecar_enqueue_telemetry_metric
4343
ddog_sidecar_connect
4444
ddog_sidecar_ping
4545
ddog_sidecar_transport_drop
46-
_dd_solib_start

ext/solib_bootstrap.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
#ifdef __linux__
3737

3838
#pragma GCC optimize("no-stack-protector")
39+
// This file runs before ld.so and before any runtime library (libc, ASAN,
40+
// etc.) is initialized. Any instrumentation that inserts calls to runtime
41+
// functions (ASAN __asan_load*, stack protector __stack_chk_fail, UBSan
42+
// __ubsan_handle_*) will produce unresolved PLT entries that crash before the
43+
// bootstrap completes.
44+
#ifdef __clang__
45+
# pragma clang attribute push(__attribute__((no_sanitize("address","undefined","thread","memory"))), apply_to = function)
46+
#endif
3947

4048
#include <elf.h>
4149
#include <stddef.h>
@@ -1113,6 +1121,10 @@ static long sys_pwrite(int fd, const void *buf, long count, long offset) {
11131121
}
11141122

11151123
// }}}
1124+
1125+
#ifdef __clang__
1126+
# pragma clang attribute pop
1127+
#endif
11161128
#endif // __linux__
11171129

11181130
// vim: foldmethod=marker

0 commit comments

Comments
 (0)