@@ -205,7 +205,7 @@ fn prefix_and_suffix<'tcx>(
205
205
let mut end = String :: new ( ) ;
206
206
match asm_binary_format {
207
207
BinaryFormat :: Elf => {
208
- let section = link_section. unwrap_or ( format ! ( ".text.{asm_name}" ) ) ;
208
+ let section = link_section. unwrap_or_else ( || format ! ( ".text.{asm_name}" ) ) ;
209
209
210
210
let progbits = match is_arm {
211
211
true => "%progbits" ,
@@ -239,7 +239,7 @@ fn prefix_and_suffix<'tcx>(
239
239
}
240
240
}
241
241
BinaryFormat :: MachO => {
242
- let section = link_section. unwrap_or ( "__TEXT,__text" . to_string ( ) ) ;
242
+ let section = link_section. unwrap_or_else ( || "__TEXT,__text" . to_string ( ) ) ;
243
243
writeln ! ( begin, ".pushsection {},regular,pure_instructions" , section) . unwrap ( ) ;
244
244
writeln ! ( begin, ".balign {align_bytes}" ) . unwrap ( ) ;
245
245
write_linkage ( & mut begin) . unwrap ( ) ;
@@ -256,7 +256,7 @@ fn prefix_and_suffix<'tcx>(
256
256
}
257
257
}
258
258
BinaryFormat :: Coff => {
259
- let section = link_section. unwrap_or ( format ! ( ".text.{asm_name}" ) ) ;
259
+ let section = link_section. unwrap_or_else ( || format ! ( ".text.{asm_name}" ) ) ;
260
260
writeln ! ( begin, ".pushsection {},\" xr\" " , section) . unwrap ( ) ;
261
261
writeln ! ( begin, ".balign {align_bytes}" ) . unwrap ( ) ;
262
262
write_linkage ( & mut begin) . unwrap ( ) ;
@@ -273,7 +273,7 @@ fn prefix_and_suffix<'tcx>(
273
273
}
274
274
}
275
275
BinaryFormat :: Wasm => {
276
- let section = link_section. unwrap_or ( format ! ( ".text.{asm_name}" ) ) ;
276
+ let section = link_section. unwrap_or_else ( || format ! ( ".text.{asm_name}" ) ) ;
277
277
278
278
writeln ! ( begin, ".section {section},\" \" ,@" ) . unwrap ( ) ;
279
279
// wasm functions cannot be aligned, so skip
0 commit comments