13 Commits

Author SHA1 Message Date
Alexandros Naskos
e9b137f23a Completed basic PE linker for stage2
Added std.coff.MachineType
Added image characteristic and section flag valued to std.coff
Added std.Target.Cpu.Arch.toCoffMachine
Fixed stage2 --watch flag on windows
2020-09-04 05:15:03 +03:00
Vexu
6f0126e957
stage2: split Scope.Container from Scope.File 2020-09-03 15:06:45 +03:00
Sahnvour
575fbd5e35 hash_map: rename to ArrayHashMap and add new HashMap implementation 2020-09-02 00:17:50 +02:00
Tadeo Kondrak
d3e5105ecc
std.zig.ast: make getTrailer/setTrailer private and add getters/setters 2020-08-30 17:18:25 -06:00
Andrew Kelley
237d9a105d stage2: support debug dumping zir as a build option
So that it's not needed to manually comment and uncomment the debug
code.
2020-08-25 22:44:18 -07:00
Andrew Kelley
e97157f71c stage2: codegen for conditional branching
* Move branch-local register and stack allocation metadata to the
   function-local struct. Conditional branches clone this data in order
   to restore it after generating machine code for a branch.
   Branch-local data is now only the instruction table mapping *ir.Inst
   to MCValue.
 * Implement conditional branching
   - Process operand deaths
   - Handle register and stack allocation metadata
 * Avoid storing unreferenced or void typed instructions into
   the branch-local instruction table.
 * Fix integer types reporting the wrong value for hasCodeGenBits.
 * Remove the codegen optimization for eliding length-0 jumps. I need to
   reexamine how this works because it was causing invalid jumps to be
   emitted.
2020-08-25 22:44:18 -07:00
Andrew Kelley
ea6a076065 stage2: fix use-after-free in elf linker code 2020-08-25 13:36:15 -07:00
Andrew Kelley
54f3b0a560 stage2: clean up SPU Mk II code
* move SPU code from std to self hosted compiler
 * change std lib comments to be descriptive rather than prescriptive
 * avoid usingnamespace
 * fix case style of error codes
 * remove duplication of producer_string
 * generalize handling of less than 64 bit arch pointers
 * clean up SPU II related test harness code
2020-08-22 13:36:08 -07:00
Noam Preil
222e23c678 Linker: make defaults read-only 2020-08-22 12:45:29 -07:00
Noam Preil
fa1d18a155 Linker: fix GOT production on 16-bit targets 2020-08-22 12:45:29 -07:00
Noam Preil
8c321f0cf5 SPU-II: Fix linking 2020-08-22 12:45:29 -07:00
Noam Preil
803a1025bb Targets: add SPU Mark II architecture 2020-08-22 12:45:29 -07:00
Andrew Kelley
89b6c47e04 stage2: decouple codegen.zig from ELF
See #6113 for an alternate way of doing this that we didn't end up
following.

Closes #6079.

I also took the opportunity here to extract C.zig and Elf.zig from
link.zig.
2020-08-21 13:25:59 -07:00