aboutsummaryrefslogtreecommitdiff
path: root/lib/std/macho.zig
AgeCommit message (Collapse)Author
2021-12-10macho: move helper functions to libstdJakub Konka
Helper functions such as `commands.sectionName`, etc. should really belong in `std.macho.section_64` extern struct.
2021-11-30macho: move nlist_64 type/flags helpers to std.machoJakub Konka
2021-08-31macho: fix allocating sections within segment when parsing objectsJakub Konka
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-08-10macho: swap out VERSION_MIN for BUILD_VERSIONJakub Konka
this makes the app successfully run on the iOS simluator!
2021-06-25Add fat/universal dylib support to zig ldTom Maenan Read Cutting
With this change zig ld can link with dynamic libraries contained within a fat/universal file that had multiple seperate binaries embedded within it for multi-arch support (in macOS). Whilst zig can still only create single-architecture executables - the ability to link with fat libraries is useful for cases where they are the easiest (or only) option to link against.
2021-05-18Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
I want the updated Drone CI stuff to get the CI green.
2021-05-18zld: parse dylibs as positionalsJakub Konka
* add preliminary rpath support * enable shared_library test on x86_64 macOS
2021-05-18zld: parse dylib idJakub Konka
2021-04-22std: fix compile errors caught by stage2 AstGenAndrew Kelley
* `comptime const` is redundant * don't use `extern enum`; specify a tag type. `extern enum` is only when you need tags to alias. But aliasing tags is a smell. I will be making a proposal shortly to remove `extern enum` from the language. * there is no such thing as `packed enum`. * instead of `catch |_|`, omit the capture entirely. * unused function definition with missing parameter name * using `try` outside of a function or test
2021-04-21macho: fix typos in consts defsJakub Konka
2021-03-17zld: fix GOT loads and indirection on x86_64Jakub Konka
2021-03-17zld: start bringing x64 up to speedJakub Konka
2021-03-17zld: merge and sort sectionsJakub Konka
2021-03-17macho: offset table part of GOTJakub Konka
2021-01-26macho: add arm64 relocation type enumJakub Konka
2021-01-08libstd: add missing MachO rebase opcodes in macho.zigJakub Konka
2020-12-31Year++Frank Denis
2020-12-17lld+macho: lld xcomp to x86_64 macos now worksJakub Konka
2020-12-09macho: cleanup export trie generation and parsingJakub Konka
Now, ExportTrie is becoming usable for larger linking contexts such as linking in multiple object files, or relinking dylibs, etc.
2020-12-09small fixes and zig fmtVexu
2020-11-26stage2 macho: generate a code sig (not valid yet)Jakub Konka
2020-11-26stage2 macho: add info about __TEXT segmentJakub Konka
2020-11-26stage2 macho: add empty CodeDirectory blobJakub Konka
2020-11-26stage2 macho: fix incorrect rebaseJakub Konka
2020-11-26stage2 MachO: add source version load cmdJakub Konka
2020-11-26stage2 MachO: add min OS version load cmdJakub Konka
2020-11-16libstd: add more MachO consts and structsJakub Konka
2020-10-04Write out LC_DYSYMTAB together with dyld_stub_binder undef symbolJakub Konka
2020-10-04Generate more MachO exe boilerplateJakub Konka
* Convert draft to generate all relevant segments and sections in right places * Do not prealloc space in text blocks until we can NOP * Write out LC_LOAD_DYLINKER command * Add LC_LOAD_DYLIB command in order to specify to load libSystem * Redo update decl exports (similar to Elf globals, globals need to be contiguous in memory)
2020-09-08Fix bug where __text section would get overwrittenJakub Konka
Fixes a bug where the last written load command would accidentally override the beginning of the __text section. Also defines missing MachO constants and relocation structs/enums. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-30Add more missing MachO constants and structsJakub Konka
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24Add (empty) __TEXT segment load commandJakub Konka
Also, link against `libSystem` by default when targeting macOS. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24Clean up draft for merging into upstreamJakub Konka
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24Link against libSystem when generating Mach-O exeJakub Konka
This is required when generating an exe on macOS. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24Specify path to dyld in Mach-OJakub Konka
This is required since an exec on macOS always has to link against libSystem.dylib. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-22Add entry_point_command struct to Mach-O definitionsJakub Konka
The `entry_point_command` is a replacement for `thread_command`, and is used for main executables to specify the location of `main()` entry point. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-18Write out Mach-O headerJakub Konka
This commit write out Mach-O header in the linker's `flush` method. The header currently only populates the magic number, filetype, and cpu info. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-02-22delete extra code, more forgivenessLemonBoy
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221