Skip to content

Commit af5b8bc

Browse files
authored
Rollup merge of rust-lang#92029 - nikic:section-flags-fix, r=davidtwco
Use debug section for .rustc For a data section, the object crate will set SHF_ALLOC by default, which is exactly what we don't want. Use a debug section instead, the same as we do for .rmeta. I checked with `objdump -h` that this produces the right flags for ELF. Fixes rust-lang#92013.
2 parents 31bc43c + 57c0cb7 commit af5b8bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_codegen_ssa/src/back/metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ pub fn create_compressed_metadata_file(
257257
return compressed.to_vec();
258258
};
259259
let section = file.add_section(
260-
file.segment_name(StandardSegment::Data).to_vec(),
260+
file.segment_name(StandardSegment::Debug).to_vec(),
261261
b".rustc".to_vec(),
262-
SectionKind::Data,
262+
SectionKind::Debug,
263263
);
264264
let offset = file.append_section_data(section, &compressed, 1);
265265

0 commit comments

Comments
 (0)