@@ -63,7 +63,7 @@ use rustc_errors::{ErrorReported, Handler};
6363use rustc_middle:: dep_graph:: { WorkProduct , WorkProductId } ;
6464use rustc_middle:: middle:: cstore:: EncodedMetadata ;
6565use rustc_middle:: ty:: TyCtxt ;
66- use rustc_session:: config:: { CrateType , Lto , OptLevel , OutputFilenames } ;
66+ use rustc_session:: config:: { Lto , OptLevel , OutputFilenames } ;
6767use rustc_session:: Session ;
6868use rustc_span:: Symbol ;
6969use rustc_span:: fatal_error:: FatalError ;
@@ -106,16 +106,8 @@ impl CodegenBackend for GccCodegenBackend {
106106 Ok ( ( codegen_results, work_products) )
107107 }
108108
109- fn link ( & self , sess : & Session , mut codegen_results : CodegenResults , outputs : & OutputFilenames ) -> Result < ( ) , ErrorReported > {
109+ fn link ( & self , sess : & Session , codegen_results : CodegenResults , outputs : & OutputFilenames ) -> Result < ( ) , ErrorReported > {
110110 use rustc_codegen_ssa:: back:: link:: link_binary;
111- if let Some ( symbols) = codegen_results. crate_info . exported_symbols . get_mut ( & CrateType :: Dylib ) {
112- // TODO:(antoyo): remove when global initializer work without calling a function at runtime.
113- // HACK: since this codegen add some symbols (e.g. __gccGlobalCrateInit) and the UI
114- // tests load libstd.so as a dynamic library, and rustc use a version-script to specify
115- // the symbols visibility, we add * to export all symbols.
116- // It seems other symbols from libstd/libcore are causing some issues here as well.
117- symbols. push ( "*" . to_string ( ) ) ;
118- }
119111
120112 link_binary :: < crate :: archive:: ArArchiveBuilder < ' _ > > (
121113 sess,
0 commit comments