cranelift-object: Make sections read only by default (#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.
This commit is contained in:
@@ -457,7 +457,7 @@ impl Module for ObjectModule {
|
|||||||
} else if relocs.is_empty() {
|
} else if relocs.is_empty() {
|
||||||
SectionKind::ReadOnlyData
|
SectionKind::ReadOnlyData
|
||||||
} else {
|
} else {
|
||||||
SectionKind::Data
|
SectionKind::ReadOnlyDataWithRel
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user