Fix relocated readonly data in custom sections

Lld doesn't allow relocations in readonly sections
This commit is contained in:
bjorn3
2020-09-21 13:38:42 +02:00
parent 010e5b9aa8
commit deb20c129a

View File

@@ -335,8 +335,10 @@ impl Backend for ObjectBackend {
sec.clone().into_bytes(),
if writable {
SectionKind::Data
} else {
} else if relocs.is_empty() {
SectionKind::ReadOnlyData
} else {
SectionKind::Data
},
)
};