diff options
| author | YANG Xudong <yangxudong@ymatrix.cn> | 2024-07-20 07:32:20 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-19 16:32:20 -0700 |
| commit | b7e48c6bcd99457f84f0043a3f4590a6ac1f4933 (patch) | |
| tree | 871de246636d7afbb67a78769fbcccecb8b59527 /lib/std/elf.zig | |
| parent | 0d1db794d580eeeb39603613baf5123df15d731a (diff) | |
| download | zig-b7e48c6bcd99457f84f0043a3f4590a6ac1f4933.tar.gz zig-b7e48c6bcd99457f84f0043a3f4590a6ac1f4933.zip | |
std: Add loongarch support for elf. (#20678)
Diffstat (limited to 'lib/std/elf.zig')
| -rw-r--r-- | lib/std/elf.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/std/elf.zig b/lib/std/elf.zig index 154982ddc4..f2206502cd 100644 --- a/lib/std/elf.zig +++ b/lib/std/elf.zig @@ -1626,6 +1626,9 @@ pub const EM = enum(u16) { /// C-SKY CSKY = 252, + /// LoongArch + LOONGARCH = 258, + /// Fujitsu FR-V FRV = 0x5441, @@ -1655,6 +1658,14 @@ pub const EM = enum(u16) { .SPARCV9 => .sparc64, .S390 => .s390x, .SPU_2 => .spu_2, + // FIXME: + // No support for .loongarch32 yet so it is safe to assume we are on .loongarch64. + // + // However, when e_machine is .LOONGARCH, we should check + // ei_class's value to decide the CPU architecture. + // - ELFCLASS32 => .loongarch32 + // - ELFCLASS64 => .loongarch64 + .LOONGARCH => .loongarch64, // there's many cases we don't (yet) handle, or will never have a // zig target cpu arch equivalent (such as null). else => null, |
