File tree 1 file changed +6
-3
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1642,10 +1642,16 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
1642
1642
// Make the binary compatible with data execution prevention schemes.
1643
1643
cmd. add_no_exec ( ) ;
1644
1644
1645
+ // OBJECT-FILES-YES
1646
+ add_local_crate_metadata_objects ( cmd, crate_type, codegen_results) ;
1647
+
1645
1648
// NO-OPT-OUT, OBJECT-FILES-NO
1646
1649
// Avoid linking to dynamic libraries unless they satisfy some undefined symbols
1647
1650
// at the point at which they are specified on the command line.
1648
1651
// Must be passed before any dynamic libraries.
1652
+ // On solaris-like systems, this also will ignore unreferenced ELF sections
1653
+ // from relocatable objects. For that reason, we move the metadata objects
1654
+ // to before this flag as they would otherwise be removed.
1649
1655
cmd. add_as_needed ( ) ;
1650
1656
1651
1657
// NO-OPT-OUT, OBJECT-FILES-NO
@@ -1697,9 +1703,6 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
1697
1703
// dynamic library.
1698
1704
cmd. export_symbols ( tmpdir, crate_type) ;
1699
1705
1700
- // OBJECT-FILES-YES
1701
- add_local_crate_metadata_objects ( cmd, crate_type, codegen_results) ;
1702
-
1703
1706
// OBJECT-FILES-YES
1704
1707
add_local_crate_allocator_objects ( cmd, codegen_results) ;
1705
1708
You can’t perform that action at this time.
0 commit comments