aboutsummaryrefslogtreecommitdiff
path: root/src/link
AgeCommit message (Collapse)Author
2024-08-13elf: write offset table entry if dirtyJakub Konka
2024-08-13elf: allocate new offset table via Atom.allocate mechanismJakub Konka
2024-08-13elf: introduce OffsetTable in ZigObject for funcs onlyJakub Konka
2024-08-12all: Handle spirv in addition to spirv(32,64) where applicable.Alex Rønne Petersen
Some of this is arbitrary since spirv (as opposed to spirv32/spirv64) refers to the version with logical memory layout, i.e. no 'real' pointers. This change at least matches what clang does.
2024-08-12std.Target: Rename glsl450 Arch tag to opengl.Alex Rønne Petersen
Versions can simply use the normal version range mechanism, or alternatively an Abi tag if that makes more sense. For now, we only care about 4.5 anyway.
2024-08-11compiler: split Decl into Nav and Caumlugg
The type `Zcu.Decl` in the compiler is problematic: over time it has gained many responsibilities. Every source declaration, container type, generic instantiation, and `@extern` has a `Decl`. The functions of these `Decl`s are in some cases entirely disjoint. After careful analysis, I determined that the two main responsibilities of `Decl` are as follows: * A `Decl` acts as the "subject" of semantic analysis at comptime. A single unit of analysis is either a runtime function body, or a `Decl`. It registers incremental dependencies, tracks analysis errors, etc. * A `Decl` acts as a "global variable": a pointer to it is consistent, and it may be lowered to a specific symbol by the codegen backend. This commit eliminates `Decl` and introduces new types to model these responsibilities: `Cau` (Comptime Analysis Unit) and `Nav` (Named Addressable Value). Every source declaration, and every container type requiring resolution (so *not* including `opaque`), has a `Cau`. For a source declaration, this `Cau` performs the resolution of its value. (When #131 is implemented, it is unsolved whether type and value resolution will share a `Cau` or have two distinct `Cau`s.) For a type, this `Cau` is the context in which type resolution occurs. Every non-`comptime` source declaration, every generic instantiation, and every distinct `extern` has a `Nav`. These are sent to codegen/link: the backends by definition do not care about `Cau`s. This commit has some minor technically-breaking changes surrounding `usingnamespace`. I don't think they'll impact anyone, since the changes are fixes around semantics which were previously inconsistent (the behavior changed depending on hashmap iteration order!). Aside from that, this changeset has no significant user-facing changes. Instead, it is an internal refactor which makes it easier to correctly model the responsibilities of different objects, particularly regarding incremental compilation. The performance impact should be negligible, but I will take measurements before merging this work into `master`. Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com> Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2024-08-10Wasm: handle ref to an extern in getDeclVAddrJakub Konka
2024-08-10Coff: handle ref to an extern in getDeclVAddrJakub Konka
2024-08-10MachO/ZigObject: handle ref to an extern in getDeclVAddrJakub Konka
2024-08-10Elf/ZigObject: handle ref to an extern in getDeclVAddrJakub Konka
Prior to this change, we would unconditionally create a symbol and atom pair for a Decl that could point to an extern, in which case no atom can be created.
2024-08-10macho: ensure we only ever put named symbols in the symtabJakub Konka
2024-08-10elf: ensure we only ever put named symbols in the symtabJakub Konka
2024-08-07elf: remove stale codeJakub Konka
2024-08-07elf: fix off-by-one direct access to symbol resolver in ZigObjectJakub Konka
2024-08-07elf: actually init symbol resolvers array in ZigObjectJakub Konka
2024-08-07elf: handle SHN_UNDEF explicitly in ZigObject.resolveSymbolsJakub Konka
2024-08-07elf: fix .eh_frame calc in relocatable modeJakub Konka
2024-08-07elf: start-stop resolution has to come after init output sectionsJakub Konka
2024-08-07elf: fix off-by-one when referring to resolved table directlyJakub Konka
2024-08-07elf: scan LinkerDefined obj for symbol indirection tooJakub Konka
2024-08-07elf: get hello-world glibc working againJakub Konka
2024-08-07elf: fix symbol resolution for ObjectsJakub Konka
2024-08-07elf: do not re-init Symbol when initializingJakub Konka
2024-08-07elf: move getStartStopBasename into ObjectJakub Konka
2024-08-07elf: fix compile errorsJakub Konka
2024-08-07elf: redo symbol mgmt and ownership in ZigObjectJakub Konka
2024-08-07elf: move symbol ownership to LinkerDefinedJakub Konka
2024-08-07elf: move symbol ownership to SharedObjectJakub Konka
2024-08-07elf: move symbol ownership to ObjectJakub Konka
2024-08-07elf: null symbol is obsoleteJakub Konka
2024-08-07elf: always create symbol extraJakub Konka
2024-08-01Merge pull request #20870 from alexrp/target-cleanup-3Andrew Kelley
`std.Target`: Remove more dead OS/architecture tags
2024-08-01Merge pull request #20884 from Rexicon226/riscvJakub Konka
2024-07-31remove hard tabs from source codeAndrew Kelley
these are illegal according to the spec
2024-07-31riscv: fix `.got` symbol loadingDavid Rubin
2024-07-30elf: fix a typo in setting atom name before it's been allocatedJakub Konka
2024-07-30elf: remove now unused globalByNameJakub Konka
2024-07-30elf: include LinkerDefined in symbol resolutionJakub Konka
2024-07-30elf: move entry tracking into LinkerDefinedJakub Konka
2024-07-30elf: move initializing and allocating linker-defined symbols into LinkerDefinedJakub Konka
2024-07-30elf: do not store merge section output section name in strings bufferJakub Konka
2024-07-30elf: init output merge sections in a separate stepJakub Konka
2024-07-30elf: move merge subsections ownership into merge sectionsJakub Konka
2024-07-30elf: simplify output section tracking for symbolsJakub Konka
2024-07-30elf: atom is always assigned output section indexJakub Konka
2024-07-30elf: remove obsolete flags from atomJakub Konka
2024-07-30elf: resolve COMDATs in more parallel-friendly wayJakub Konka
2024-07-30elf: skip storing comdat group signature globallyJakub Konka
2024-07-30elf: move ownership of atoms into objectsJakub Konka
2024-07-30elf: move ownership of comdat groups to ObjectJakub Konka