aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/zld.zig
AgeCommit message (Collapse)Author
2024-01-24macho: copy over new implementation sources from zldJakub Konka
2024-01-09Add support for `--(no-)undefined-version`dhash
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt> Co-authored-by: Jakub Konka <kubkon@jakubkonka.com> Co-authored-by: Samuel Cantero <scanterog@gmail.com> Co-authored-by: Giorgos Georgiou <giorgos.georgiou@datadoghq.com> Co-authored-by: Carl Åstholm <carl@astholm.se>
2024-01-01link: accept the update arena in flushAndrew Kelley
This branch introduced an arena allocator for temporary allocations in Compilation.update. Almost every implementation of flush() inside the linker code was already creating a local arena that had the lifetime of the function call. This commit passes the update arena so that all those local ones can be deleted, resulting in slightly more efficient memory usage with every compilation update. While at it, this commit also removes the Compilation parameter from the linker flush function API since a reference to the Compilation is now already stored in `link.File`.
2024-01-01move force_undefined_symbols into CompilationAndrew Kelley
This field is needed by Compilation regardless of whether a link file is instantiated. Fixes an invalid check for bin_file=null.
2024-01-01compiler: push entry symbol name resolution into the linkerAndrew Kelley
This is necessary because on COFF, the entry symbol name is not known until the linker has looked at the set of global symbol names to determine which of the four possible main entry points is present.
2024-01-01linker: rename intermediary_basname to zcu_object_sub_pathAndrew Kelley
2024-01-01fix remaining compile errors except oneAndrew Kelley
2024-01-01compiler: update many references to bin_file.optionsAndrew Kelley
2024-01-01linkers: update references to "options" fieldAndrew Kelley
2024-01-01linker: update target referencesAndrew Kelley
2024-01-01linker: update output_mode referencesAndrew Kelley
2024-01-01move a large chunk of linker logic away from "options"Andrew Kelley
These options are only supposed to be provided to the initialization functions, resolved, and then computed values stored in the appropriate place (base struct or the object-format-specific structs). Many more to go...
2023-11-19compiler: correct unnecessary uses of 'var'mlugg
2023-11-04elf: redo strings management in the linkerJakub Konka
* atom names - are stored locally and pulled from defining object's strtab * local symbols - same * global symbols - in principle, we could store them locally, but for better debugging experience - when things go wrong - we store the offsets in a global strtab used by the symbol resolver
2023-10-31std.builtin.Endian: make the tags lower caseAndrew Kelley
Let's take this breaking change opportunity to fix the style of this enum.
2023-10-31mem: fix ub in writeIntJacob Young
Use inline to vastly simplify the exposed API. This allows a comptime-known endian parameter to be propogated, making extra functions for a specific endianness completely unnecessary.
2023-10-30macho: implement enough of extern handling to pass comptime export testsJakub Konka
2023-10-10revert compiler_rt: no need to put it in a static libraryAndrew Kelley
This mostly reverts 6e0904504155d3cba80955c108116170fd739aec however it leaves intact the linker supporting both obj and lib files, and the frontend choosing which one to create.
2023-10-10compiler_rt: no need to put it in a static libraryAndrew Kelley
It's simpler to link against compiler_rt.o directly.
2023-09-25kubkon review changes: 2Michael Dusan
- drop --verbose-link printing until ready to put in driver frontend
2023-09-25kubkon review changes: 1Michael Dusan
general: - rename `DarwinSdkLayout` → `DarwinSdkLayout` - drop `DarwinSdkLayout.installation` (not needed for darwin) - document struct inferSdkVersion: - use explicit allocator - avoid trying to infer SDK ver from vendored path
2023-09-25macos: better SDK version detectionMichael Dusan
SDK version detection: - read SDKSettings.json before inferral from SDK path - vendored libc: add SDKSettings.json for SDK version info resolveLibSystem: - adjust search order to { search_dirs, { sysroot or vendored }} - previous search order was { sysroot, search_dirs, vendored }
2023-09-25macos: discontinue redundant search/link for libcMichael Dusan
2023-09-25macho: add verbose args for -platform_versionMichael Dusan
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-08-31macho: report missing libSystem/libc system libraries to the userJakub Konka
2023-08-30macho: report basic __eh_frame problems as errorsJakub Konka
2023-08-30macho: improve error reporting for re-exports mismatchJakub Konka
2023-08-30macho: refactor resolving and parsing dependent dylibsJakub Konka
2023-08-29macho: simplify handling and reporting parsing errorsJakub Konka
2023-08-29macho: handle mismatched and missing platform errorsJakub Konka
2023-08-29link: remove unused darwin_sdk_version fieldJakub Konka
2023-08-29macho: parse platform info from each object file into Platform structJakub Konka
2023-08-29macho: make MachO.requiresCodeSignature accept link.OptionsJakub Konka
2023-08-29macho: remove MachO.requiresThunks as it is obsoleteJakub Konka
2023-08-29macho: create an explicit error set for parse functionsJakub Konka
2023-08-29macho: convert log.err when CPU arch is mismatched into actual errorsJakub Konka
2023-08-29macho: report symbol collision as compiler errorJakub Konka
2023-08-29macho: fix 32bit compilation issuesJakub Konka
2023-08-29macho: fix overalignment of stubs on aarch64Jakub Konka
2023-08-29macho: fix compilation issuesJakub Konka
2023-08-29macho: merge Zld state with MachO stateJakub Konka
2023-08-29macho: save indexes to all sections of interestJakub Konka
2023-08-29macho: unify resolving globalsJakub Konka
2023-08-29macho: unify segment handlingJakub Konka
2023-08-29macho: unify writeLinkeditSegmentData funcJakub Konka
2023-08-29macho: unify creating atomsJakub Konka
2023-08-29macho: unify allocating special symbolsJakub Konka
2023-08-29macho: unify writeSegmentHeaders funcJakub Konka
2023-08-29macho: move initSection into MachO from ZldJakub Konka