Skip to content

stage2: native backends: lower const slices#10862

Merged
kubkon merged 4 commits intomasterfrom
elf-lower-slices
Feb 11, 2022
Merged

stage2: native backends: lower const slices#10862
kubkon merged 4 commits intomasterfrom
elf-lower-slices

Conversation

@kubkon
Copy link
Copy Markdown
Member

@kubkon kubkon commented Feb 11, 2022

  • x64 + arm codegen: handle lowering of const slice pointers
  • elf: store pointer relocations indexed by containing atom - in getDeclVAddr it may happen that the target Decl has not been allocated space in virtual memory. In this case, we store a relocation in the linker-global table which we will iterate over when flushing the module, and fill in any missing addresses in the final binary. Note that for optimisation, if the address was resolved at the time of a call to getDeclVAddr, we skip relocating this atom.
  • macho: correctly lower slices including relocation and rebasing tracking
  • x64 + aarch64 - expand Mir instructions requiring the knowledge of the containing atom to pass the symbol index into the linker's table from codegen via mir to the emitter, to then utilise it in the linker when allocating memory
  • x64: pass more behavior tests

In `getDeclVAddr`, it may happen that the target `Decl` has not
been allocated space in virtual memory. In this case, we store a
relocation in the linker-global table which we will iterate over
when flushing the module, and fill in any missing address in the
final binary. Note that for optimisation, if the address was resolved
at the time of a call to `getDeclVAddr`, we skip relocating this
atom.

This commit also adds the glue code for lowering const slices in
the ARM backend.
Match changes required to `Elf` linker, which enable lowering
of const slices on `MachO` targets.

Expand `Mir` instructions requiring the knowledge of the containing
atom - pass the symbol index into the linker's table from codegen
via mir to emitter, to then utilise it in the linker.
@kubkon kubkon merged commit e1a5353 into master Feb 11, 2022
@kubkon kubkon deleted the elf-lower-slices branch February 11, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant