aboutsummaryrefslogtreecommitdiff
path: root/lib/std/coff.zig
AgeCommit message (Collapse)Author
2025-10-10Coff: implement threadlocal variablesJacob Young
2025-10-03std.coff: Fix size of ImportHeader.typesRyan Liptak
2025-10-03std.coff: Set default values for ImportHeader sig1/sig2 fieldsRyan Liptak
Just makes this a bit nicer to work with since those fields only have 1 intended value.
2025-10-03std.coff: Add sizeOf function to WeakExternalDefinitionRyan Liptak
Convenience function similar in nature to Symbol.sizeOf
2025-10-03std.coff: Fix SectionHeader.setAlignment (off by 1)Ryan Liptak
Previously, `setAlignment` would set the value to 1 fewer than it should, so if you were intending to set alignment to 8 bytes, it would actually set it to 4 bytes, etc.
2025-10-02Coff2: create a new linker from scratchJacob Young
2025-09-30change one million thingsmlugg
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2024-08-23std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.Alex Rønne Petersen
These are fundamentally incapable of producing accurate information for reasons I've laid out in #20771. Since our only use of these functions is to check that object files have the correct machine type, and since #21020 made `std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over to that and compare the machine type tags instead. Closes #20771.
2024-08-15std.coff: Capitalize MachineType.{Unknown,Thumb} for consistency.Alex Rønne Petersen
2024-08-15std.coff: Remove MachineType.fromTargetCpuArch().Alex Rønne Petersen
This does the same thing as std.Target.Cpu.Arch.toCoffMachine(). Just use that.
2024-07-24std.coff: Add missing entries to MachineType.Alex Rønne Petersen
Sources: * https://learn.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants * https://github.com/wine-mirror/wine/blob/88a28aa5757ae74d9997b470d70216f10974247f/include/winnt.h#L2720-L2758
2024-07-12std: Add loongarch support for coff. (#20583)YANG Xudong
* std: Add loongarch support for coff. See: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types * Update toCoffMachine.
2024-07-09std: fix typos (#20560)Jora Troosh
2024-07-07std.coff: fix setAlignmentKrzysztof Wolicki
2024-03-29lib/std/coff: add ImportNameType.NAME_EXPORTAS variantJakub Konka
2024-03-22lib/std/coff: add ImportHeader, and Relocation metadataJakub Konka
2024-03-22lib/std/coff: add undocumented machine type ARM64ECJakub Konka
2024-03-22lib/std/coff: allow for unhandled enum valuesJakub Konka
2024-03-14coff: only store PDB basenameElaine Gibson
2023-11-19lib: correct unnecessary uses of 'var'mlugg
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-09-02std.coff: Fixed compile error.Michal Ziulek
2023-08-15coff: handle the case of there being no PDB pathkcbanner
2023-08-15debug: support looking up debug symbols in both PDB and DWARF debug info, ↵kcbanner
instead of only using DWARF if `.debug_info` is present coff: support reading from memory loaded by the loader, or a mapped file
2023-08-06std: remove some unused imports (#16710)Zachary Raineri
2023-07-27`std.coff`: check strtab lengths against `data` lengthRohlem
Fixes illegal behavior. Invalid-length sections are now skipped in `Coff.getSectionByName`.
2023-07-20dwarf: fixup integer overflow in readEhPointerkcbanner
debug: handle the possibility of eh_frame / debug_frame being mapped in memory or loaded from disk
2023-07-20debug: fix reading -gdwarf generated debug sections in COFF fileskcbanner
I had accidentally regressed support for -gdwarf in 461fb499f3cff9038a427eae120fb34defc9ab38 when I changed the logic to use the already-mapped exe/dll image instead of loading it from disk. The string table is mapped as all zeroes by the loader, so if a section header's name is longer than 8 bytes (like the ones generated by -gdwarf), then the name can't be read. Now, if any section headers require the string table, the file is mapped from disk. windows: Add NtCreateSection/NtMapViewOfSection/NtUnmapViewOfSection
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-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-01-08windows: rework DebugInfo to use less file operations and fix some memory ↵kcbanner
management issues
2022-11-18run zig fmt on everything checked by CIStevie Hryciw
2022-11-04all: rename i386 to x86Ali Chraghi
2022-08-31coff: add import table definitionsJakub Konka
2022-08-30coff: add base relocation related typesJakub Konka
2022-08-30coff: move Symtab and Strtab out of coff.CoffJakub Konka
This should ease interfacing with different std.coff functionalities.
2022-08-30Merge pull request #12677 from ziglang/coff-linkerJakub Konka
coff: initial rewrite of the COFF/PE linker
2022-08-30coff: write headers to fileJakub Konka
2022-08-30coff: reorganize the linkerJakub Konka
2022-08-28coff: publicize and flesh out more image constantsWilliam Sengir
2022-08-28coff: fix reading COFF header offsetWilliam Sengir
2022-08-26coff: do not pull in std.log into coff.zig definitionsJakub Konka
2022-08-24fix coff.zig with const qualifier convert problemmax
2022-08-23coff: improve default COFF/PE object parserJakub Konka
We now do not allocate memory for headers and other metadata unless requested by the caller. Instead, we read-in the entire contents of the image into memory and operate on pointers and casts wherever possible. I have a left a TODO to hook up Windows' memory-mapped API here in-place of standard `readToEndAlloc` which should be more memory proof on memory constrained hosts. This commit also supplements our `std.coff` with a lot missing basic extern structs required to make our COFF linker.
2022-08-19coff: change improperly used packed struct into extern structJakub Konka
2022-04-28std.coff: parse out codebase and entrypoint from optionalheaderErik Hugne
2022-04-21debug: fix resource (de)allocation for Elf and Coff targetsJakub Konka
With this change, it is now possible to safely call `var di = std.debug.openSelfDebugInfo(gpa)`. Calling then `di.deinit()` on the object will correctly free all allocated resources. Ensure we store the result of `mmap` with correct alignment.