Skip to content

Commit 9022d9c

Browse files
committed
[xray] Apply default visibility to __xray_CustomEvent/__xray_TypedEvent
`__xray_customevent` and `__xray_typedevent` are built-in functions in Clang. With -fxray-instrument, they are lowered to `__xray_CustomEvent` (with 2 arguments) or `__xray_TypedEvent` (with 3 arguments). xray patching is supported for shared objects, but they may contain `__xray_customevent` and `__xray_typedevent` references that need to be satisfied by default visibility definitions exported by the executable. lld since df54f62, like GNU ld, catches the scenario at link time.
1 parent 446d38c commit 9022d9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler-rt/lib/xray/xray_trampoline_AArch64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ ASM_SYMBOL(__xray_ArgLoggerEntry):
138138
ret
139139
ASM_SIZE(__xray_ArgLoggerEntry)
140140

141+
// __xray_*Event have default visibility so that they can be referenced by user
142+
// DSOs that do not link against the runtime.
141143
.global ASM_SYMBOL(__xray_CustomEvent)
142-
ASM_HIDDEN(__xray_CustomEvent)
143144
ASM_TYPE_FUNCTION(__xray_CustomEvent)
144145
ASM_SYMBOL(__xray_CustomEvent):
145146
SAVE_REGISTERS
@@ -153,7 +154,6 @@ ASM_SYMBOL(__xray_CustomEvent):
153154
ASM_SIZE(__xray_CustomEvent)
154155

155156
.global ASM_SYMBOL(__xray_TypedEvent)
156-
ASM_HIDDEN(__xray_TypedEvent)
157157
ASM_TYPE_FUNCTION(__xray_TypedEvent)
158158
ASM_SYMBOL(__xray_TypedEvent):
159159
SAVE_REGISTERS

compiler-rt/lib/xray/xray_trampoline_x86_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ LOCAL_LABEL(arg1entryFail):
257257

258258
//===----------------------------------------------------------------------===//
259259

260+
// __xray_*Event have default visibility so that they can be referenced by user
261+
// DSOs that do not link against the runtime.
260262
.global ASM_SYMBOL(__xray_CustomEvent)
261-
ASM_HIDDEN(__xray_CustomEvent)
262263
.align 16, 0x90
263264
ASM_TYPE_FUNCTION(__xray_CustomEvent)
264265
# LLVM-MCA-BEGIN __xray_CustomEvent
@@ -284,7 +285,6 @@ LOCAL_LABEL(customEventCleanup):
284285
//===----------------------------------------------------------------------===//
285286

286287
.global ASM_SYMBOL(__xray_TypedEvent)
287-
ASM_HIDDEN(__xray_TypedEvent)
288288
.align 16, 0x90
289289
ASM_TYPE_FUNCTION(__xray_TypedEvent)
290290
# LLVM-MCA-BEGIN __xray_TypedEvent

0 commit comments

Comments
 (0)