rust/compiler
Javier Blazquez 4ed846ad4d Add -Z no-unique-section-names to reduce ELF header bloat.
This change adds a new compiler flag that can help reduce the size of
ELF binaries that contain many functions.

By default, when enabling function sections (which is the default for most
targets), the LLVM backend will generate different section names for each
function. For example, a function "func" would generate a section called
".text.func". Normally this is fine because the linker will merge all those
sections into a single one in the binary. However, starting with LLVM 12
(llvm/llvm-project@ee5d1a0), the backend will
also generate unique section names for exception handling, resulting in
thousands of ".gcc_except_table.*" sections ending up in the final binary
because some linkers don't currently merge or strip these EH sections.
This can bloat the ELF headers and string table significantly in
binaries that contain many functions.

The new option is analogous to Clang's -fno-unique-section-names, and
instructs LLVM to generate the same ".text" and ".gcc_except_table"
section for each function, resulting in smaller object files and
potentially a smaller final binary.
2021-10-11 12:09:32 -07:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Rollup merge of #89487 - FabianWolff:issue-89396, r=petrochenkov 2021-10-04 21:12:42 -07:00
rustc_ast_lowering Add desugaring mark to while loop 2021-10-02 17:41:14 -05:00
rustc_ast_passes Rollup merge of #89494 - FabianWolff:issue-84075, r=davidtwco 2021-10-04 21:12:43 -07:00
rustc_ast_pretty
rustc_attr Move some HashStable impls. 2021-10-03 16:08:50 +02:00
rustc_borrowck Rollup merge of #89504 - Aaron1011:rpit-nll-static, r=nikomatsakis 2021-10-04 23:56:24 -07:00
rustc_builtin_macros Practice diagnostic message convention 2021-10-03 16:16:28 +09:00
rustc_codegen_cranelift Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_codegen_gcc Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_codegen_llvm Add -Z no-unique-section-names to reduce ELF header bloat. 2021-10-11 12:09:32 -07:00
rustc_codegen_ssa Remove re-export. 2021-10-03 16:08:54 +02:00
rustc_const_eval Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_data_structures Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplett 2021-10-04 21:12:33 -07:00
rustc_driver Auto merge of #89363 - oli-obk:in_tracing_we_trust, r=Mark-Simulacrum 2021-10-05 12:52:43 +00:00
rustc_error_codes
rustc_errors
rustc_expand
rustc_feature Stabilize const_panic 2021-10-04 02:33:33 -04:00
rustc_fs_util
rustc_graphviz
rustc_hir Move some HashStable impls. 2021-10-03 16:08:50 +02:00
rustc_hir_pretty
rustc_incremental
rustc_index Rollup merge of #89508 - jhpratt:stabilize-const_panic, r=joshtriplett 2021-10-04 13:58:17 -07:00
rustc_infer Make diangostic item names consistent 2021-10-02 19:38:19 -05:00
rustc_interface Add -Z no-unique-section-names to reduce ELF header bloat. 2021-10-11 12:09:32 -07:00
rustc_lexer
rustc_lint Rollup merge of #89473 - FabianWolff:issue-89469, r=joshtriplett 2021-10-04 21:12:38 -07:00
rustc_lint_defs
rustc_llvm Add -Z no-unique-section-names to reduce ELF header bloat. 2021-10-11 12:09:32 -07:00
rustc_macros Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_metadata Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_middle Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_mir_build
rustc_mir_dataflow Rollup merge of #89508 - jhpratt:stabilize-const_panic, r=joshtriplett 2021-10-04 13:58:17 -07:00
rustc_mir_transform Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_monomorphize
rustc_parse Use TokenKind::similar_tokens() 2021-10-04 22:13:00 +02:00
rustc_parse_format
rustc_passes Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_plugin_impl Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_privacy
rustc_query_impl Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_query_system Add some inlining. 2021-10-03 16:08:57 +02:00
rustc_resolve Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_save_analysis Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_serialize
rustc_session Add -Z no-unique-section-names to reduce ELF header bloat. 2021-10-11 12:09:32 -07:00
rustc_span Auto merge of #88175 - camsteffen:let-desugar-span, r=Manishearth 2021-10-03 21:44:10 +00:00
rustc_symbol_mangling Remove re-export. 2021-10-03 16:08:54 +02:00
rustc_target Remove various unused feature gates 2021-10-02 19:09:18 +02:00
rustc_trait_selection Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_traits
rustc_ty_utils Remove various unused feature gates 2021-10-02 19:09:18 +02:00
rustc_type_ir
rustc_typeck Rollup merge of #89482 - hkmatsumoto:patch-diagnostics, r=joshtriplett 2021-10-04 23:56:23 -07:00