s390x: Enable object backend (#4680)
This enables the object backend for s390x, in particular the processing of all required relocations. This uncovered a bug: we need to use PLT relocations for the target of calls, which we currently do not. Fixed by adding a new S390xPLTRel32Dbl reloc type and using it where needed.
This commit is contained in:
@@ -3216,7 +3216,7 @@ impl MachInstEmit for Inst {
|
||||
}
|
||||
|
||||
let opcode = 0xc05; // BRASL
|
||||
let reloc = Reloc::S390xPCRel32Dbl;
|
||||
let reloc = Reloc::S390xPLTRel32Dbl;
|
||||
if let Some(s) = state.take_stack_map() {
|
||||
sink.add_stack_map(StackMapExtent::UpcomingBytes(6), s);
|
||||
}
|
||||
|
||||
@@ -3077,6 +3077,7 @@ impl MachInstLabelUse for LabelUse {
|
||||
fn from_reloc(reloc: Reloc, addend: Addend) -> Option<Self> {
|
||||
match (reloc, addend) {
|
||||
(Reloc::S390xPCRel32Dbl, 2) => Some(LabelUse::PCRel32Dbl),
|
||||
(Reloc::S390xPLTRel32Dbl, 2) => Some(LabelUse::PCRel32Dbl),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user