aboutsummaryrefslogtreecommitdiff
path: root/src/link/Elf.zig
AgeCommit message (Collapse)Author
2023-09-21compiler: move struct types into InternPool properAndrew Kelley
Structs were previously using `SegmentedList` to be given indexes, but were not actually backed by the InternPool arrays. After this, the only remaining uses of `SegmentedList` in the compiler are `Module.Decl` and `Module.Namespace`. Once those last two are migrated to become backed by InternPool arrays as well, we can introduce state serialization via writing these arrays to disk all at once. Unfortunately there are a lot of source code locations that touch the struct type API, so this commit is still work-in-progress. Once I get it compiling and passing the test suite, I can provide some interesting data points such as how it affected the InternPool memory size and performance comparison against master branch. I also couldn't resist migrating over a bunch of alignment API over to use the log2 Alignment type rather than a mismash of u32 and u64 byte units with 0 meaning something implicitly different and special at every location. Turns out you can do all the math you need directly on the log2 representation of alignments.
2023-09-13elf: skip writing non-alloc and zerofill atomsJakub Konka
2023-09-13elf: allocate locals and globals in objectsJakub Konka
2023-09-13elf: re-enable linking compiler_rtJakub Konka
2023-09-13elf: do not store Symbol's index in SymbolJakub Konka
2023-09-13elf: parse archivesJakub Konka
2023-09-13elf: allocate .bss section and matching PHDRJakub Konka
2023-09-13elf: look for entry point globally if not set by incremental compilerJakub Konka
2023-09-13elf: enable linker for non-incremental code pathsJakub Konka
2023-09-13elf: add u64 to usize casts where requiredJakub Konka
2023-09-12elf: clean up and unify symbol ref handling in relocsJakub Konka
Also, this lets us re-enable proper undefined symbols tracking.
2023-09-12elf: include C compilation artifacts on the linker lineJakub Konka
2023-09-12elf: resolve and write objects to fileJakub Konka
2023-09-12elf: allocate objects, currently atom-by-atomJakub Konka
2023-09-12elf: set output section index when parsing objectsJakub Konka
2023-09-12elf: add simplistic reloc scanning mechanismJakub Konka
2023-09-12elf: claim unresolved dangling symbols that can be claimedJakub Konka
2023-09-12elf: mark imports-exports; populate symtab with objectsJakub Konka
2023-09-12elf: add simplistic symbol resolutionJakub Konka
2023-09-12elf: start fixing symbol resolutionJakub Konka
2023-09-12elf: report undefined symbols in objectsJakub Konka
2023-09-11elf: add prelim impl of Object parsingJakub Konka
2023-09-11elf: add basic error reporting for positional parsingJakub Konka
2023-09-11elf: report undefined symbols as errorsJakub Konka
2023-09-11elf: emit relocation to an extern functionJakub Konka
2023-09-11elf: simplify handling of relocs for atomsJakub Konka
2023-09-10elf: decouple notion of atom free list from shdrsJakub Konka
Not every section will have the need for such a free list.
2023-09-10elf: allocate linker defined symbolsJakub Konka
2023-09-10elf: write linker-defined symbols to symtabJakub Konka
2023-09-10elf: create required linker-defined symbolsJakub Konka
2023-09-09elf: clean up naming and remove unused functionsJakub Konka
2023-09-08elf: rename program_headers to phdrsJakub Konka
2023-09-08elf: write $got symbols into the symtabJakub Konka
2023-09-08elf: store Index rather than ?Index in Atom; gen ABS STT_FILE for zig sourceJakub Konka
2023-09-08elf: store GOT index in symbol extra array; use GotSection for GOTJakub Konka
2023-09-07elf: use zld's update mechanism for symtab for Zig moduleJakub Konka
2023-09-06elf: write symbtabJakub Konka
2023-09-06elf: set atom namesJakub Konka
2023-09-06elf: lift-off - get it to compile and run until the error!Jakub Konka
2023-09-06elf: make everything upside down - track by Symbol.Index rather than Atom.IndexJakub Konka
2023-09-05elf: start porting abstraction of input fileJakub Konka
2023-09-04elf: atom.index of 0 reserved for null atomJakub Konka
2023-09-04elf: remove dead codeJakub Konka
2023-09-04elf: simplify accessors to symbols, atoms, etcJakub Konka
2023-09-03elf: add global symbol resolverJakub Konka
2023-09-02elf: mark dirty .symtab shdr after updating sh_info fieldJakub Konka
2023-09-02elf: correctly set symtab's sh_info to first global indexJakub Konka
2023-09-02elf: write all symbols in bulk in flushJakub Konka
This avoids leaving undefined bytes in the output file in case a decl has been garbage collected before it's been committed into the binary. This should have minimal impact on performance since we have to write globals on every iteration anyway.
2023-09-02elf: write symbol names into .strtab rather than .shstrtabJakub Konka
2023-08-21frontend: directly pass resolved frameworks container to the linkerJakub Konka
We can infer the framework name from the included resolved framework path. Fix hash implementation, and bump linker hash value from 9 to 10.