| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Just makes this a bit nicer to work with since those fields only have 1 intended value.
|
|
Convenience function similar in nature to Symbol.sizeOf
|
|
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.
|
|
|
|
|
|
and delete deprecated alias std.io
|
|
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.
|
|
|
|
This does the same thing as std.Target.Cpu.Arch.toCoffMachine(). Just use that.
|
|
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
|
|
* std: Add loongarch support for coff.
See: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types
* Update toCoffMachine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Let's take this breaking change opportunity to fix the style of this
enum.
|
|
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.
|
|
|
|
|
|
instead of only using DWARF if `.debug_info` is present
coff: support reading from memory loaded by the loader, or a mapped file
|
|
|
|
Fixes illegal behavior. Invalid-length sections are now skipped in `Coff.getSectionByName`.
|
|
debug: handle the possibility of eh_frame / debug_frame being mapped in memory or loaded from disk
|
|
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
|
|
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
|
|
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
|
|
|
|
management issues
|
|
|
|
|
|
|
|
|
|
This should ease interfacing with different std.coff functionalities.
|
|
coff: initial rewrite of the COFF/PE linker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|