aboutsummaryrefslogtreecommitdiff
path: root/src/link/Elf/eh_frame.zig
AgeCommit message (Collapse)Author
2025-09-30link.Elf: restore eh_frame_hdr search table buildingmlugg
At least, when there's not a ZigObject. The old behavior was incorrect in the presence of a ZigObject, and this doesn't really mix nicely with incremental compilation anyway; but when the objects are all external, we may as well build the search table.
2025-09-30fix compiler ftbfs from std.macho and std.dwarf changesmlugg
2025-09-30change one million thingsmlugg
2025-09-08fix linker code writing undefined memory to the output fileAndrew Kelley
missing `extern` on a struct. but also all these instances that call pwriteAll with a `@ptrCast` are endianness bugs. this should be changed to use File.Writer and call writeSliceEndian instead. this commit fixes one immediate problem but does not fix everything.
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-25start adding big endian RISC-V supportAlex Rønne Petersen
The big endian RISC-V effort is mostly driven by MIPS (the company) which is pivoting to RISC-V, and presumably needs a big endian variant to fill the niche that big endian MIPS (the ISA) did. GCC already supports these targets, but LLVM support will only appear in 22; this commit just adds the necessary target knowledge and checks on our end.
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-07-07compiler: update a bunch of format stringsAndrew Kelley
2025-07-07compiler: fix a bunch of format stringsAndrew Kelley
2025-07-07compiler: update all instances of std.fmt.FormatterAndrew Kelley
2025-01-15wasm linker: fix crashes when parsing compiler_rtAndrew Kelley
2024-10-29link/Elf: ensure we always sort all relocations by r_offset in -r modeJakub Konka
According to a comment in mold, this is the expected (and desired) condition by the linkers, except for some architectures (RISCV and Loongarch) where this condition does not have to upheld. If you follow the changes in this patch and in particular doc comments I have linked the comment/code in mold that explains and implements this. I have also modified `testEhFrameRelocatable` test to now test both cases such that `zig ld -r a.o b.o -o c.o` and `zig ld -r b.o a.o -o d.o`. In both cases, `c.o` and `d.o` should produce valid object files which was not the case before this patch.
2024-10-23link.Elf: untangle parseObject and parseArchiveAndrew Kelley
from link.Elf, so that they can be used earlier in the pipeline
2024-10-11link: consolidate diagnosticsAndrew Kelley
By organizing linker diagnostics into this struct, it becomes possible to share more code between linker backends, and more importantly it becomes possible to pass only the Diag struct to some functions, rather than passing the entire linker state object in. This makes data dependencies more obvious, making it easier to rearrange code and to multithread. Also fix MachO code abusing an atomic variable. Not only was it using the wrong atomic operation, it is unnecessary additional state since the state is already being protected by a mutex.
2024-10-11link.Elf: group section indexesAndrew Kelley
so they cannot be forgotten when updating them after sorting them.
2024-09-04elf: fix 32bit buildJakub Konka
2024-09-04elf: misc .eh_frame management fixesJakub Konka
2024-09-04elf: emit relocs for self-hosted generated .eh_frame sectionJakub Konka
2024-09-04elf: fix relocatable modeJakub Konka
2024-08-30Elf: fix reference from `eh_frame_hdr` to `eh_frame`Jacob Young
2024-08-30dwarf: share and use `std.dwarf.EH_PE` constantsJacob Young
2024-08-25elf: simplify output section symbol trackingJakub Konka
2024-08-25elf: streamline sections containerJakub Konka
2024-08-07elf: fix .eh_frame calc in relocatable modeJakub Konka
2024-08-07elf: fix compile errorsJakub Konka
2024-07-30elf: simplify output section tracking for symbolsJakub Konka
2024-07-30elf: move ownership of atoms into objectsJakub Konka
2024-07-22macho: redo input file parsing in prep for multithreadingJakub Konka
2024-03-08elf+aarch64: implement enough to link dynamically with gcc as the driverJakub Konka
2024-02-21elf+riscv: implement enough to get basic hello world in C workingJakub Konka
2024-02-21elf+aarch64: resolve .eh_frame relocsJakub Konka
2024-02-21elf: simplify logic for resolving .eh_frame relocs on different archesJakub Konka
2024-02-17lib/std/elf: refactor reloc enum valuesJakub Konka
2024-02-17elf: add riscv dynamic relocsJakub Konka
2024-02-16elf: enable adding support for additional cpu archsJakub Konka
2024-02-13elf: store relative offsets in atom and symbolJakub Konka
2024-02-12elf: do not prealloc input objects, pread selectivelyJakub Konka
2024-01-01fix remaining compile errors except oneAndrew Kelley
2024-01-01linker: fix some allocator referencesAndrew Kelley
2023-11-19compiler: correct unnecessary uses of 'var'mlugg
2023-11-09elf: correctly format output .eh_frame when emitting relocatableJakub Konka
2023-11-09elf: emit .rela.eh_frame section contentsJakub Konka
2023-11-09elf: calculate required size for .rela.eh_frameJakub Konka
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-16elf: fix 32bit buildJakub Konka
2023-10-16elf: handle .eh_frame and non-alloc sectionsJakub Konka
2023-10-16elf: refactor object.shdrContents to never error outJakub Konka