Use the correct export kind for __rust_alloc_error_handler_should_panic · rust-lang/rust@c073286 (original) (raw)

Original file line number Diff line number Diff line change
@@ -219,13 +219,18 @@ fn exported_symbols_provider_local<'tcx>(
219 219
220 220 // Mark allocator shim symbols as exported only if they were generated.
221 221 if allocator_kind_for_codegen(tcx).is_some() {
222 -for symbol_name in ALLOCATOR_METHODS
222 +for (symbol_name, export_kind) in ALLOCATOR_METHODS
223 223 .iter()
224 -.map(|method
224 +.map(|method
225 +(
226 +mangle_internal_symbol(tcx, global_fn_name(method.name).as_str()),
227 +SymbolExportKind::Text,
228 +)
229 +})
225 230 .chain([
226 -mangle_internal_symbol(tcx, "__rust_alloc_error_handler"),
227 -mangle_internal_symbol(tcx, OomStrategy::SYMBOL),
228 -mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE),
231 +(mangle_internal_symbol(tcx, "__rust_alloc_error_handler"), SymbolExportKind::Text),
232 +(mangle_internal_symbol(tcx, OomStrategy::SYMBOL), SymbolExportKind::Data),
233 +(mangle_internal_symbol(tcx, NO_ALLOC_SHIM_IS_UNSTABLE), SymbolExportKind::Text),
229 234 ])
230 235 {
231 236 let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, &symbol_name));
@@ -234,7 +239,7 @@ fn exported_symbols_provider_local<'tcx>(
234 239 exported_symbol,
235 240 SymbolExportInfo {
236 241 level: SymbolExportLevel::Rust,
237 -kind: SymbolExportKind::Text,
242 +kind: export_kind,
238 243 used: false,
239 244 rustc_std_internal_symbol: true,
240 245 },