diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-08-07 13:13:04 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-08-07 13:41:17 +0000 |
| commit | 6c02653c4a564a2a1509dc55bdec2e5b8f02bdd9 (patch) | |
| tree | fa08ac49fc21a4bd38b1888c564bfc98b48e50ee /tests/codegen-llvm/sanitizer | |
| parent | 9b1a30e5e69e1537ef6eb6eb829eb47075206dea (diff) | |
| download | rust-6c02653c4a564a2a1509dc55bdec2e5b8f02bdd9.tar.gz rust-6c02653c4a564a2a1509dc55bdec2e5b8f02bdd9.zip | |
Prevent name collisions with internal implementation details
The implementation of the linkage attribute inside extern blocks defines symbols starting with _rust_extern_with_linkage_. If someone tries to also define this symbol you will get a symbol conflict or even an ICE. By adding an unpredictable component to the symbol name, this becomes less of an issue.
Diffstat (limited to 'tests/codegen-llvm/sanitizer')
| -rw-r--r-- | tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs b/tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs index 00e9b5029af..b3cb6dfdd37 100644 --- a/tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs +++ b/tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs @@ -10,7 +10,7 @@ unsafe extern "C" { #[linkage = "extern_weak"] static FOO: Option<unsafe extern "C" fn(f64) -> ()>; } -// CHECK: @_rust_extern_with_linkage_FOO = internal global ptr @FOO +// CHECK: @_rust_extern_with_linkage_{{.*}}_FOO = internal global ptr @FOO fn main() { unsafe { |
