aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/dead_strip.zig
AgeCommit message (Collapse)Author
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-07-07std.fmt: fully remove format string from format methodsAndrew Kelley
Introduces `std.fmt.alt` which is a helper for calling alternate format methods besides one named "format".
2025-07-07MachO: update to new std.io APIsAndrew Kelley
2025-02-22zig build fmtAndrew Kelley
2024-07-22macho: run more things in parallelJakub Konka
2024-07-18macho: migrate UnwindInfoJakub Konka
2024-07-18macho: move unwind info records ownership to ObjectsJakub Konka
2024-01-24macho: fix dead stripping logic to exclude debug sectionsJakub Konka
2024-01-24macho: handle dead stripping of atomsJakub Konka
2024-01-24macho: get the ball rolling!Jakub Konka
2024-01-24macho: copy over new implementation sources from zldJakub Konka
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-01fix remaining compile errors except oneAndrew 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
2023-11-10macho: resolve special section/segment boundary symbolsJakub Konka
Boundary symbols have a special name prefix: * section$start$segname$sectname * section$stop$segname$sectname * segment$start$segname * segment$stop$segname and will resolve to either start or end of the respective section/segment if found. If not found, we return an error stating we couldn't find the requested section/segment rather than silently failing and resolving the address to 0 which seems to be the case with Apple's ld64.
2023-08-30macho: report basic __eh_frame problems as errorsJakub Konka
2023-08-29macho: fix compilation issuesJakub Konka
2023-08-29macho: merge Zld state with MachO stateJakub Konka
2023-08-29macho: move symbol resolver into zld driver's stateJakub Konka
2023-08-29macho: remove dead codeJakub Konka
2023-08-29macho: use TableSection for stub entries in zld driverJakub Konka
Write thunks separately from other atoms - this can still be improved by not using atoms at all, but one thing at a time.
2023-08-29macho: unify Atom concept between driversJakub Konka
2023-08-29macho: unify Section concept across driversJakub Konka
2023-08-29macho: add simple error reporting for misc errorsJakub Konka
2023-08-29macho: unify concept of SymbolWithLoc across driversJakub Konka
2023-08-03macho: set first and last atom indexes to 0 when marking section for pruningJakub Konka
2023-08-02macho: track unwind/dwarf cfi records by symbol rather than atomJakub Konka
This solves the nuance case of compiling hand-crafted assembly files which do not feature `MH_SUBSECTIONS_VIA_SYMBOLS` flag resulting in input `Atom`s encompassing multiple symbols each with unique unwind information.
2023-06-25macho: add fixes to __eh_frame parsing emitted by Nix C++ compilerJakub Konka
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-04-01link: handle -u flag in all linkersJakub Konka
Also clean up parsing of linker args - reuse `ArgsIterator`. In MachO, ensure we add every symbol marked with `-u` as undefined before proceeding with symbol resolution. Additionally, ensure those symbols are never garbage collected. MachO entry_in_dylib test: pass `-u _my_main` when linking executable so that it is not incorrectly garbage collected by the linker.
2023-04-01macho: do not assume entrypoint is definedJakub Konka
2023-03-22macho+zld: refactor parsing of relocation targetJakub Konka
2023-03-20macho+zld: relax assumption about dead strip atoms uniquenessJakub Konka
In case the compiler outputted an object file that is not slicable into subsections, entry point may overlap with a section atom which is perfectly fine, so don't panic in that case.
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-02-06macho: downgrade alignment requirements for symtab in object filesJakub Konka
Parse and sort relocations by address descending.
2023-01-21macho: synthesise unwind records in absence of compact unwind sectionJakub Konka
Unlike Apple ld, we will not do any DWARF CFI parsing and simply output DWARF type unwind records.
2023-01-20zld: parse, synthesise and emit unwind recordsJakub Konka
2022-12-09macho+zld: skip atomless synthetic globals in dead_stripJakub Konka
They are implicitly marked live.
2022-11-18run zig fmt on everything checked by CIStevie Hryciw
2022-10-30macho: fix regression in dead strip for x86_64Jakub Konka
Correctly handle calculating encompassing atoms for local relocations (`r_extern == 0`).
2022-10-24link: add an explicit error set for flush() and flushModule()Andrew Kelley
This makes it easier to understand how control flow should happen in various cases; already just by doing this it is revealed that UndefinedSymbol and UndefinedSymbolReference should be merged, and that MissingMainEntrypoint should be removed in favor of the ErrorFlags mechanism thath we already have for missing the main entrypoint. The main motivation for this change, however, is preventing a compile error when there is conditional compilation inside linker implementations, causing the flush() error set to depend on compilation options. With this change, the error set is fixed, and, notably, the `-Donly-c` flag no longer has compilation errors due to this error set.
2022-10-22macho: some docsJakub Konka
2022-10-22macho: refactor dead code stripping conditionsJakub Konka
1. If an object file was not compiled with `MH_SUBSECTIONS_VIA_SYMBOLS` such a hand-written ASM on x86_64, treat the entire object file as not suitable for dead code stripping aka a GC root. 2. If there are non-extern relocs within a section, treat the entire section as a root, at least temporarily until we work out the exact conditions for marking the atoms live.
2022-10-22macho: do not skip over SUBTRACTOR reloc when dead strippingJakub Konka
2022-10-22macho: fix handling of lack of subsections and tracking of inner symbolsJakub Konka
2022-10-22macho: skip parsing __eh_frame until we know how to handle itJakub Konka