diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-01-30 11:54:07 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-01-30 13:41:20 -0800 |
| commit | a2cc5d68a7d4a739b3da62540cb09f313de2f452 (patch) | |
| tree | 9b6638b579e8fc5c89f11fa531a927aae7f25088 /src/libpanic_abort | |
| parent | 70f7d5842f29d4900f24420b030f144d21f3c5fc (diff) | |
rustc: Add an option to default hidden visibility
This commit adds a new option to target specifictions to specify that symbols should be "hidden" visibility by default in LLVM. While there are no existing targets that take advantage of this the `wasm32-unknown-unknown` target will soon start to use this visibility. The LLD linker currently interprets `hidden` as "don't export this from the wasm module" which is what we want for 90% of our functions. While the LLD linker does have a "export this symbol" argument which is what we use for other linkers, it was also somewhat easier to do this change instead which'll involve less arguments flying around. Additionally there's no need for non-`hidden` visibility for most of our symbols! This change should not immediately impact the wasm targets as-is, but rather this is laying the foundations for soon integrating LLD as a linker for wasm code.
Diffstat (limited to 'src/libpanic_abort')
| -rw-r--r-- | src/libpanic_abort/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs index c3bd6a2bc18..5f768ef4399 100644 --- a/src/libpanic_abort/lib.rs +++ b/src/libpanic_abort/lib.rs @@ -27,10 +27,12 @@ #![feature(libc)] #![feature(panic_runtime)] #![feature(staged_api)] +#![feature(rustc_attrs)] // Rust's "try" function, but if we're aborting on panics we just call the // function as there's nothing else we need to do here. #[no_mangle] +#[rustc_std_internal_symbol] pub unsafe extern fn __rust_maybe_catch_panic(f: fn(*mut u8), data: *mut u8, _data_ptr: *mut usize, @@ -50,6 +52,7 @@ pub unsafe extern fn __rust_maybe_catch_panic(f: fn(*mut u8), // will kill us with an illegal instruction, which will do a good enough job for // now hopefully. #[no_mangle] +#[rustc_std_internal_symbol] pub unsafe extern fn __rust_start_panic(_data: usize, _vtable: usize) -> u32 { abort(); |
