Skip to content

Self-hosted linkers are very endian-dirty #25961

@alexrp

Description

@alexrp

The ELF and Mach-O linkers are riddled with endian bugs; grepping for asBytes, @ptrCast, or writeAll will turn up most of them. Also, SPIR-V:

zig/src/link/SpirV.zig

Lines 288 to 290 in 73f863a

// TODO endianness bug. use file writer and call writeSliceEndian instead
linker.base.file.?.writeAll(@ptrCast(linked_module)) catch |err|
return diags.fail("failed to write: {s}", .{@errorName(err)});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorlinking

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions