| Age | Commit message (Collapse) | Author |
|
The code accidentally used the phdr offset instead of the shdr one while
iterating over the section headers.
Fixes #6338
|
|
|
|
add SPDX license identifier
copyright ownership is zig contributors
|
|
map EBADF to error values for read and write
|
|
|
|
The buffer index was declared as `u64`, which overflows `usize` on a
32-bit target.
The following example program failed to compile for 32-bit targets:
```zig
const std = @import("std");
pub fn main() !void {
const alloc = std.testing.allocator;
const file = std.io.getStdIn();
_ = try std.elf.readAllHeaders(alloc, file);
}
```
```
lib/zig/std/elf.zig:543:36: error: expected type 'usize', found 'u64'
const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
^
lib/zig/std/elf.zig:543:36: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
^
lib/zig/std/elf.zig:543:35: note: referenced here
const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
^
lib/zig/std/elf.zig:348:5: note: referenced here
try preadNoEof(file, &hdr_buf, 0);
^
lib/zig/std/elf.zig:392:19: note: referenced here
.header = try readHeader(file),
```
|
|
|
|
|
|
This is direct result of review comments left by andrewrk and
daurnimator. It makes sense to map `ENOTCAPABLE` into a more generic
`error.AccessDenied`.
|
|
|
|
|
|
|
|
regression from #5266
closes #5270
|
|
|
|
|
|
|
|
|
|
The main goal here is to make the function pointers comptime, so that we
don't have to do the crazy stuff with async function frames.
Since InStream, OutStream, and SeekableStream are already generic
across error sets, it's not really worse to make them generic across the
vtable as well.
See #764 for the open issue acknowledging that using generics for these
abstractions is a design flaw.
See #130 for the efforts to make these abstractions non-generic.
This commit also changes the OutStream API so that `write` returns
number of bytes written, and `writeAll` is the one that loops until the
whole buffer is written.
|
|
|
|
|
|
* re-introduce `std.build.Target` which is distinct from `std.Target`.
`std.build.Target` wraps `std.Target` so that it can be annotated as
"the native target" or an explicitly specified target.
* `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a
struct which has the tag as well as version range information.
* `std.elf` gains some more ELF header constants.
* `std.Target.parse` gains the ability to parse operating system
version ranges as well as glibc version.
* Added `std.Target.isGnuLibC()`.
* self-hosted dynamic linker detection and glibc version detection.
This also adds the improved logic using `/usr/bin/env` rather than
invoking the system C compiler to find the dynamic linker when zig
is statically linked. Related: #2084
Note: this `/usr/bin/env` code is work-in-progress.
* `-target-glibc` CLI option is removed in favor of the new `-target`
syntax. Example: `-target x86_64-linux-gnu.2.27`
closes #1907
|
|
llvm-objcopy. To use it, do 'exe.installRaw("kernel.bin");' where exe is a LibExeObjStep
Part of #2826
|
|
|
|
* Implements #3768. This is a sweeping breaking change that requires
many (trivial) edits to Zig source code. Array values no longer
coerced to slices; however one may use `&` to obtain a reference to
an array value, which may then be coerced to a slice.
* Adds `IrInstruction::dump`, for debugging purposes. It's useful to
call to inspect the instruction when debugging Zig IR.
* Fixes bugs with result location semantics. See the new behavior test
cases, and compile error test cases.
* Fixes bugs with `@typeInfo` not properly resolving const values.
* Behavior tests are passing but std lib tests are not yet. There
is more work to do before merging this branch.
|
|
and also integration with std.Target.Arch
|
|
|
|
|
|
that's all this commit does. further commits will fix cli flags and
such.
see #2221
|