matter-labs / era-compiler-llvm

ZKsync fork of the LLVM framework
Other
28 stars 14 forks source link

[LLD] Provide meaningful default linker script #529

Open atrosinenko opened 4 months ago

atrosinenko commented 4 months ago

Make LLD use more appropriate defaults for EraVM target, so that the support introduced in #510 could be used without custom linker script.

With the existing semantics of relocations, this likely assumes using overlays because code[...] and stack[...] operands both use addresses from the [0, 2^16) range but from different address spaces. Another possibility is permitting some truncation when processing relocation or further splitting R_ERAVM_16_SCALE_32 into "code" and "stack" forms, so code and stack pages of EraVM could be assigned to different VMA ranges in ELF.

asl commented 4 months ago

Tagging @PavelKopyl