authorgravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-06-21 21:52:50+08:00
committergravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-06-25 22:12:55+08:00
log360deedcf15c9e8cc0179f9e18b8562aadc8ba09
treed8124a7ad48754028b2604f47ae050b0fc093b89
parente048c90545c4f7df1377f9fcdce14ce5e5a2056f
signaturebadge-check Signed by SSH key SHA256:IEYEjkZlkUTr5U9GiDAmZU/4eZus2t2RsxusyhQqwao

std.elf: add LoongArch e_flags definition

Link: https://github.com/loongson/la-abi-specs/blob/44ef5f63e1755e1a165915ea3b2d98d35f68eed0/laelf.adoc?plain=1#L74-L93

1 files changed, 18 insertions(+), 0 deletions(-)

lib/std/elf.zig+18
...@@ -3263,3 +3263,21 @@ pub const gnu_hash = struct {...@@ -3263,3 +3263,21 @@ pub const gnu_hash = struct {
3263 try std.testing.expectEqual(0x8ae9f18e, calculate("flapenguin.me"));3263 try std.testing.expectEqual(0x8ae9f18e, calculate("flapenguin.me"));
3264 }3264 }
3265};3265};
3266
3267pub const loongarch = struct {
3268 /// Ehdr.e_flags bits of LoongArch
3269 pub const EFlags = packed struct(Word) {
3270 base_abi_modifier: BaseAbiModifier,
3271 abi_extension: AbiExtension,
3272 abi_version: u2,
3273 reserved: u24 = 0,
3274
3275 pub const BaseAbiModifier = enum(u3) {
3276 s = 1,
3277 f = 2,
3278 d = 3,
3279 _,
3280 };
3281 pub const AbiExtension = enum(u3) { base = 0, _ };
3282 };
3283};