Move metadata objects to before as-needed/zignore flags to make sure they are kept.
This commit is contained in:
parent
1c6868aa21
commit
cffef3385d
1 changed files with 6 additions and 3 deletions
|
@ -1642,10 +1642,16 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
|
||||||
// Make the binary compatible with data execution prevention schemes.
|
// Make the binary compatible with data execution prevention schemes.
|
||||||
cmd.add_no_exec();
|
cmd.add_no_exec();
|
||||||
|
|
||||||
|
// OBJECT-FILES-YES
|
||||||
|
add_local_crate_metadata_objects(cmd, crate_type, codegen_results);
|
||||||
|
|
||||||
// NO-OPT-OUT, OBJECT-FILES-NO
|
// NO-OPT-OUT, OBJECT-FILES-NO
|
||||||
// Avoid linking to dynamic libraries unless they satisfy some undefined symbols
|
// Avoid linking to dynamic libraries unless they satisfy some undefined symbols
|
||||||
// at the point at which they are specified on the command line.
|
// at the point at which they are specified on the command line.
|
||||||
// Must be passed before any dynamic libraries.
|
// Must be passed before any dynamic libraries.
|
||||||
|
// On solaris-like systems, this also will ignore unreferenced ELF sections
|
||||||
|
// from relocatable objects. For that reason, we move the metadata objects
|
||||||
|
// to before this flag as they would otherwise be removed.
|
||||||
cmd.add_as_needed();
|
cmd.add_as_needed();
|
||||||
|
|
||||||
// NO-OPT-OUT, OBJECT-FILES-NO
|
// NO-OPT-OUT, OBJECT-FILES-NO
|
||||||
|
@ -1697,9 +1703,6 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
|
||||||
// dynamic library.
|
// dynamic library.
|
||||||
cmd.export_symbols(tmpdir, crate_type);
|
cmd.export_symbols(tmpdir, crate_type);
|
||||||
|
|
||||||
// OBJECT-FILES-YES
|
|
||||||
add_local_crate_metadata_objects(cmd, crate_type, codegen_results);
|
|
||||||
|
|
||||||
// OBJECT-FILES-YES
|
// OBJECT-FILES-YES
|
||||||
add_local_crate_allocator_objects(cmd, codegen_results);
|
add_local_crate_allocator_objects(cmd, codegen_results);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue