authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-26 15:02:19+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-26 15:02:19+02:00
log1240134c8b8b6c4ce9f885f695671363ac4fe10a
treea6e7312ef75c5a7e4d456915ef4f94dc4ed15e45
parent80269c1f5384d6f11cd5bab981d23297b6b8cf0b
parentd0557a699e19ad7350d0689e90fdb3d3f94708f4
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #20788 from alexrp/elf-dt

`std.elf`: Add some definitions for the newer RELR relocations

1 files changed, 11 insertions(+), 1 deletions(-)

lib/std/elf.zig+11-1
...@@ -84,7 +84,10 @@ pub const DT_ENCODING = 32;...@@ -84,7 +84,10 @@ pub const DT_ENCODING = 32;
84pub const DT_PREINIT_ARRAY = 32;84pub const DT_PREINIT_ARRAY = 32;
85pub const DT_PREINIT_ARRAYSZ = 33;85pub const DT_PREINIT_ARRAYSZ = 33;
86pub const DT_SYMTAB_SHNDX = 34;86pub const DT_SYMTAB_SHNDX = 34;
87pub const DT_NUM = 35;87pub const DT_RELRSZ = 35;
88pub const DT_RELR = 36;
89pub const DT_RELRENT = 37;
90pub const DT_NUM = 38;
88pub const DT_LOOS = 0x6000000d;91pub const DT_LOOS = 0x6000000d;
89pub const DT_HIOS = 0x6ffff000;92pub const DT_HIOS = 0x6ffff000;
90pub const DT_LOPROC = 0x70000000;93pub const DT_LOPROC = 0x70000000;
...@@ -859,6 +862,8 @@ pub const Elf64_Rela = extern struct {...@@ -859,6 +862,8 @@ pub const Elf64_Rela = extern struct {
859 return @truncate(self.r_info);862 return @truncate(self.r_info);
860 }863 }
861};864};
865pub const Elf32_Relr = Elf32_Word;
866pub const Elf64_Relr = Elf64_Xword;
862pub const Elf32_Dyn = extern struct {867pub const Elf32_Dyn = extern struct {
863 d_tag: Elf32_Sword,868 d_tag: Elf32_Sword,
864 d_val: Elf32_Addr,869 d_val: Elf32_Addr,
...@@ -1052,6 +1057,11 @@ pub const Rela = switch (@sizeOf(usize)) {...@@ -1052,6 +1057,11 @@ pub const Rela = switch (@sizeOf(usize)) {
1052 8 => Elf64_Rela,1057 8 => Elf64_Rela,
1053 else => @compileError("expected pointer size of 32 or 64"),1058 else => @compileError("expected pointer size of 32 or 64"),
1054};1059};
1060pub const Relr = switch (@sizeOf(usize)) {
1061 4 => Elf32_Relr,
1062 8 => Elf64_Relr,
1063 else => @compileError("expected pointer size of 32 or 64"),
1064};
1055pub const Shdr = switch (@sizeOf(usize)) {1065pub const Shdr = switch (@sizeOf(usize)) {
1056 4 => Elf32_Shdr,1066 4 => Elf32_Shdr,
1057 8 => Elf64_Shdr,1067 8 => Elf64_Shdr,