File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2435,6 +2435,13 @@ fn linker_with_args(
2435
2435
// Passed after compiler-generated options to support manual overriding when necessary.
2436
2436
add_user_defined_link_args ( cmd, sess) ;
2437
2437
2438
+ // ------------ Builtin configurable linker scripts ------------
2439
+ // The user's link args should be able to overwrite symbols in the compiler's
2440
+ // linker script that were weakly defined (i.e. defined with `PROVIDE()`). For this
2441
+ // to work correctly, the user needs to be able to specify linker arguments like
2442
+ // `--defsym` and `--script` *before* any builtin linker scripts are evaluated.
2443
+ add_link_script ( cmd, sess, tmpdir, crate_type) ;
2444
+
2438
2445
// ------------ Object code and libraries, order-dependent ------------
2439
2446
2440
2447
// Post-link CRT objects.
@@ -2469,8 +2476,6 @@ fn add_order_independent_options(
2469
2476
2470
2477
let apple_sdk_root = add_apple_sdk ( cmd, sess, flavor) ;
2471
2478
2472
- add_link_script ( cmd, sess, tmpdir, crate_type) ;
2473
-
2474
2479
if sess. target . os == "fuchsia"
2475
2480
&& crate_type == CrateType :: Executable
2476
2481
&& !matches ! ( flavor, LinkerFlavor :: Gnu ( Cc :: Yes , _) )
You can’t perform that action at this time.
0 commit comments