@@ -326,7 +326,6 @@ pub(crate) trait Linker {
326326 link_or_cc_args ( self , & [ path] ) ;
327327 }
328328 fn gc_sections ( & mut self , keep_metadata : bool ) ;
329- fn no_gc_sections ( & mut self ) ;
330329 fn full_relro ( & mut self ) ;
331330 fn partial_relro ( & mut self ) ;
332331 fn no_relro ( & mut self ) ;
@@ -688,12 +687,6 @@ impl<'a> Linker for GccLinker<'a> {
688687 }
689688 }
690689
691- fn no_gc_sections ( & mut self ) {
692- if self . is_gnu || self . sess . target . is_like_wasm {
693- self . link_arg ( "--no-gc-sections" ) ;
694- }
695- }
696-
697690 fn optimize ( & mut self ) {
698691 if !self . is_gnu && !self . sess . target . is_like_wasm {
699692 return ;
@@ -1010,10 +1003,6 @@ impl<'a> Linker for MsvcLinker<'a> {
10101003 }
10111004 }
10121005
1013- fn no_gc_sections ( & mut self ) {
1014- self . link_arg ( "/OPT:NOREF,NOICF" ) ;
1015- }
1016-
10171006 fn full_relro ( & mut self ) {
10181007 // noop
10191008 }
@@ -1243,10 +1232,6 @@ impl<'a> Linker for EmLinker<'a> {
12431232 // noop
12441233 }
12451234
1246- fn no_gc_sections ( & mut self ) {
1247- // noop
1248- }
1249-
12501235 fn optimize ( & mut self ) {
12511236 // Emscripten performs own optimizations
12521237 self . cc_arg ( match self . sess . opts . optimize {
@@ -1418,10 +1403,6 @@ impl<'a> Linker for WasmLd<'a> {
14181403 self . link_arg ( "--gc-sections" ) ;
14191404 }
14201405
1421- fn no_gc_sections ( & mut self ) {
1422- self . link_arg ( "--no-gc-sections" ) ;
1423- }
1424-
14251406 fn optimize ( & mut self ) {
14261407 // The -O flag is, as of late 2023, only used for merging of strings and debuginfo, and
14271408 // only differentiates -O0 and -O1. It does not apply to LTO.
@@ -1567,10 +1548,6 @@ impl<'a> Linker for L4Bender<'a> {
15671548 }
15681549 }
15691550
1570- fn no_gc_sections ( & mut self ) {
1571- self . link_arg ( "--no-gc-sections" ) ;
1572- }
1573-
15741551 fn optimize ( & mut self ) {
15751552 // GNU-style linkers support optimization with -O. GNU ld doesn't
15761553 // need a numeric argument, but other linkers do.
@@ -1734,10 +1711,6 @@ impl<'a> Linker for AixLinker<'a> {
17341711 self . link_arg ( "-bgc" ) ;
17351712 }
17361713
1737- fn no_gc_sections ( & mut self ) {
1738- self . link_arg ( "-bnogc" ) ;
1739- }
1740-
17411714 fn optimize ( & mut self ) { }
17421715
17431716 fn pgo_gen ( & mut self ) {
@@ -1982,8 +1955,6 @@ impl<'a> Linker for PtxLinker<'a> {
19821955
19831956 fn gc_sections ( & mut self , _keep_metadata : bool ) { }
19841957
1985- fn no_gc_sections ( & mut self ) { }
1986-
19871958 fn pgo_gen ( & mut self ) { }
19881959
19891960 fn no_crt_objects ( & mut self ) { }
@@ -2057,8 +2028,6 @@ impl<'a> Linker for LlbcLinker<'a> {
20572028
20582029 fn gc_sections ( & mut self , _keep_metadata : bool ) { }
20592030
2060- fn no_gc_sections ( & mut self ) { }
2061-
20622031 fn pgo_gen ( & mut self ) { }
20632032
20642033 fn no_crt_objects ( & mut self ) { }
@@ -2139,8 +2108,6 @@ impl<'a> Linker for BpfLinker<'a> {
21392108
21402109 fn gc_sections ( & mut self , _keep_metadata : bool ) { }
21412110
2142- fn no_gc_sections ( & mut self ) { }
2143-
21442111 fn pgo_gen ( & mut self ) { }
21452112
21462113 fn no_crt_objects ( & mut self ) { }
0 commit comments