Skip to content

Commit 1e6c94b

Browse files
authored
cranelift-object: Make sections read only by default (bytecodealliance#5619)
This changes the default section type to be `ReadOnlyDataWithRel` instead of `Data`. On COFF types the CRT initializers do not run unless their section is read only. The new SectionKind makes these sections read only for COFF and MachO, but leaves it as Writable as required by ELF.
1 parent 539c42e commit 1e6c94b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cranelift/object/src/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl Module for ObjectModule {
457457
} else if relocs.is_empty() {
458458
SectionKind::ReadOnlyData
459459
} else {
460-
SectionKind::Data
460+
SectionKind::ReadOnlyDataWithRel
461461
},
462462
)
463463
};

0 commit comments

Comments
 (0)