@@ -806,7 +806,7 @@ fn link_natively(
806806
807807 // eprintln!("Library dirs: {:?}", library_search_dirs);
808808 // Native libraries
809- for native_lib in codegen_results. crate_info . native_libraries . values ( ) . flatten ( ) {
809+ for native_lib in & codegen_results. crate_info . used_libraries {
810810 // eprintln!("native lib {}", native_lib.name);
811811 if let Some ( ref path) = native_lib. filename {
812812 // eprintln!(" located at {path:?}");
@@ -833,21 +833,21 @@ fn link_natively(
833833 // Scan native libraries, sources of .ctors/.dtors
834834 let mut problematic_objects = vec ! [ ] ;
835835 let sections = & [ ".ctors" , ".dtors" ] ;
836- for path in obj_candidates {
837- match std:: process:: Command :: new ( "readelf" ) . arg ( "-S" ) . arg ( & path) . output ( ) {
838- Ok ( output) => {
839- let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
840- for section in sections {
841- if stdout. lines ( ) . any ( |line| line. contains ( section) ) {
842- problematic_objects. push ( ( path. clone ( ) , section. to_string ( ) ) ) ;
843- }
844- }
845- }
846- Err ( error) => {
847- eprintln ! ( "Cannot run readelf -S: {error:?}" )
848- }
849- }
850- }
836+ // for path in obj_candidates {
837+ // match std::process::Command::new("readelf").arg("-S").arg(&path).output() {
838+ // Ok(output) => {
839+ // let stdout = String::from_utf8_lossy(&output.stdout);
840+ // for section in sections {
841+ // if stdout.lines().any(|line| line.contains(section)) {
842+ // problematic_objects.push((path.clone(), section.to_string()));
843+ // }
844+ // }
845+ // }
846+ // Err(error) => {
847+ // eprintln!("Cannot run readelf -S: {error:?}")
848+ // }
849+ // }
850+ // }
851851
852852 let mut cmd = linker_with_args (
853853 & linker_path,
@@ -1059,14 +1059,15 @@ fn link_natively(
10591059 if let Ok ( file) = object:: read:: File :: parse ( data. as_slice ( ) ) {
10601060 for section_name in sections {
10611061 if let Some ( _section) = file. section_by_name ( section_name) {
1062+ eprintln ! ( "{section_name} FOUND IN FINAL ARTIFACT!" ) ;
10621063 problematic_objects
10631064 . push ( ( temp_filename. to_path_buf ( ) , section_name. to_string ( ) ) ) ;
10641065 }
10651066 }
10661067 }
10671068 }
10681069 if !problematic_objects. is_empty ( ) {
1069- eprintln ! ( "PROBLEMATIC OBJECtS \n {problematic_objects:?}" ) ;
1070+ eprintln ! ( "PROBLEMATIC OBJECTS \n {problematic_objects:?}" ) ;
10701071 panic ! ( "{problematic_objects:?}" ) ;
10711072 }
10721073
0 commit comments