aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/Object.zig
AgeCommit message (Collapse)Author
6 dayslink: update to new file system APIsAndrew Kelley
6 daysupdate all stat() to stat(io)Andrew Kelley
2025-11-20update deprecated ArrayListUnmanaged usage (#25958)Benjamin Jurk
2025-11-20std.debug: split up Mach-O debug info handlingMatthew Lugg
Like ELF, we now have `std.debug.MachOFile` for the host-independent parts, and `std.debug.SelfInfo.MachO` for logic requiring the file to correspond to the running program.
2025-10-10MachO: emit absolute path in N_OSO stabsmlugg
This path being relative is unconventional and causes issues for us if the output artifact is ever used from a different cwd than the one it was built from. The behavior implemented by this commit of always emitting these paths as absolute was actually the behavior in 0.14.x, but it regressed in 0.15.1 due to internal reworks to path handling which led to relative paths being more common in the compiler internals. Resolves: #25433
2025-09-30fix compiler ftbfs from std.macho and std.dwarf changesmlugg
2025-09-30yet moremlugg
2025-08-31std.fmt: delete deprecated APIsAndrew Kelley
std.fmt.Formatter -> std.fmt.Alt std.fmt.format -> std.Io.Writer.print
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-07-07compiler: update all instances of std.fmt.FormatterAndrew Kelley
2025-07-07MachO: revert unfinished changesAndrew Kelley
2025-07-07MachO: update to new std.io APIsAndrew Kelley
2025-07-07update compiler source to new APIsAndrew Kelley
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-02-22link.MachO: Add support for the -x flag (discard local symbols).Alex Rønne Petersen
This can also be extended to ELF later as it means roughly the same thing there. This addresses the main issue in #21721 but as I don't have a macOS machine to do further testing on, I can't confirm whether zig cc is able to pass the entire cgo test suite after this commit. It can, however, cross-compile a basic program that uses cgo to x86_64-macos-none which previously failed due to lack of -x support. Unlike previously, the resulting symbol table does not contain local symbols (such as C static functions). I believe this satisfies the related donor bounty: https://ziglang.org/news/second-donor-bounty
2025-01-15macho linker: conform to explicit error setsAndrew Kelley
Makes linker functions have small error sets, required to report diagnostics properly rather than having a massive error set that has a lot of codes. Other linker implementations are not ported yet. Also the branch is not passing semantic analysis yet.
2024-12-02macho: refactors errors from parsing DWARFJakub Konka
Currently we don't report any errors to the user due to a bug in self-hosted x86_64-macos backend.
2024-12-02macho: move things around in MachO/Object.zig and refactorJakub Konka
2024-12-02macho: handle DWARFv5 when parsing debug info in objectsJakub Konka
2024-10-12macho: create dummy atom of size 0 marking end of a sectionJakub Konka
Some compilers such as Go reference the end of a section (addr + size) which cannot be contained in any non-zero atom (since then this atom would exceed section boundaries). In order to facilitate this behaviour, we create a dummy zero-sized atom at section end (addr + size).
2024-10-10link: fix false positive crtbegin/crtend detectionAndrew Kelley
Embrace the Path abstraction, doing more operations based on directory handles rather than absolute file paths. Most of the diff noise here comes from this one. Fix sorting of crtbegin/crtend atoms. Previously it would look at all path components for those strings. Make the C runtime path detection partially a pure function, and move some logic to glibc.zig where it belongs.
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-23link: Rename InvalidCpuArch error to InvalidMachineType.Alex Rønne Petersen
2024-07-22macho: cache string lenJakub Konka
2024-07-22macho: run more things in parallelJakub Konka
2024-07-22macho: redo input file parsing in prep for multithreadingJakub Konka
2024-07-18macho: reinstate duplicate definition checkingJakub Konka
2024-07-18macho: fix 32bit compilation issuesJakub Konka
2024-07-18macho: re-enable relocatable modeJakub Konka
2024-07-18macho: fix symbol visibility merging logicJakub Konka
2024-07-18macho: we do not yet support interposable symbolsJakub Konka
2024-07-18macho: bring back parts of arJakub Konka
2024-07-18macho: fix compile errorsJakub Konka
2024-07-18macho: migrate some of MachO driverJakub Konka
2024-07-18macho: migrate Atom and SymbolJakub Konka
2024-07-18macho: migrate Object to self-ownership of atoms and symbolsJakub Konka
2024-07-18macho: revamp how we compute dyld relocsJakub Konka
2024-07-18macho: move unwind info records ownership to ObjectsJakub Konka
2024-05-24link/macho: fix perf bug in DWARF parsingJakub Konka
2024-05-23link/macho: fix 32bit buildJakub Konka
2024-05-23link/macho: ensure we set alignment of literals to max alignmentJakub Konka
2024-05-23link/macho: apply fixes to deduping logicJakub Konka
* test non-ObjC literal deduping logic
2024-05-23link/macho: dedup literals in objects and internal object fileJakub Konka
2024-04-25fix: object size error in archivezhylmzr
2024-04-22link/macho: make --verbose-link represent the actual linker lineJakub Konka
2024-04-22link/macho: introduce Atom extras for out-of-band dataJakub Konka
2024-03-01macho: correctly find N_GSYM symbols when parsing symbol stabsJakub Konka
In `ld -r` mode, the linker will emit `N_GSYM` for any defined external symbols as well as private externals. In the former case, the thing is easy since `N_EXT` bit will be set in the nlist's type. In the latter however we will encounter a local symbol with `N_PEXT` bit set (non-extern, but was private external) which we also need to include when resolving symbol stabs. The major change in the logic for parsing symbol stabs per input object file is that we no longer try to force-resolve a `N_GSYM` as a global symbol. This was a mistake since every symbol stab always describes a symbol defined within the parsed input object file. We then work out if we should forward `N_GSYM` in the output symtab after we have resolved all symbols, but never before - intel we lack when initially parsing symbol stabs. Therefore, we simply record which symbol has a debug symbol stab, and work out its precise type when emitting output symtab after symbol resolution has been done.
2024-02-07macho: use preadAll to read in object files when emitting archiveJakub Konka