aarch64: Support GOT Relative relocations in PIC mode (#5550)
* cranelift: Add `adrp` encoding to AArch64 backend * cranelift: Support GOT Symbol References in AArch64 * cranelift: Add MachO GOT relocations * cranelift: Do not mark the GOT PageOffset12 MachO relocation as relative
This commit is contained in:
@@ -678,6 +678,38 @@ impl ObjectModule {
|
||||
12,
|
||||
)
|
||||
}
|
||||
Reloc::Aarch64AdrGotPage21 => match self.object.format() {
|
||||
object::BinaryFormat::Elf => (
|
||||
RelocationKind::Elf(object::elf::R_AARCH64_ADR_GOT_PAGE),
|
||||
RelocationEncoding::Generic,
|
||||
21,
|
||||
),
|
||||
object::BinaryFormat::MachO => (
|
||||
RelocationKind::MachO {
|
||||
value: object::macho::ARM64_RELOC_GOT_LOAD_PAGE21,
|
||||
relative: true,
|
||||
},
|
||||
RelocationEncoding::Generic,
|
||||
21,
|
||||
),
|
||||
_ => unimplemented!("Aarch64AdrGotPage21 is not supported for this file format"),
|
||||
},
|
||||
Reloc::Aarch64Ld64GotLo12Nc => match self.object.format() {
|
||||
object::BinaryFormat::Elf => (
|
||||
RelocationKind::Elf(object::elf::R_AARCH64_LD64_GOT_LO12_NC),
|
||||
RelocationEncoding::Generic,
|
||||
12,
|
||||
),
|
||||
object::BinaryFormat::MachO => (
|
||||
RelocationKind::MachO {
|
||||
value: object::macho::ARM64_RELOC_GOT_LOAD_PAGEOFF12,
|
||||
relative: false,
|
||||
},
|
||||
RelocationEncoding::Generic,
|
||||
12,
|
||||
),
|
||||
_ => unimplemented!("Aarch64Ld64GotLo12Nc is not supported for this file format"),
|
||||
},
|
||||
Reloc::S390xPCRel32Dbl => (RelocationKind::Relative, RelocationEncoding::S390xDbl, 32),
|
||||
Reloc::S390xPLTRel32Dbl => (
|
||||
RelocationKind::PltRelative,
|
||||
|
||||
Reference in New Issue
Block a user