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;
8484pub const DT_PREINIT_ARRAY = 32;
8585pub const DT_PREINIT_ARRAYSZ = 33;
8686pub 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;
8891pub const DT_LOOS = 0x6000000d;
8992pub const DT_HIOS = 0x6ffff000;
9093pub const DT_LOPROC = 0x70000000;
......@@ -859,6 +862,8 @@ pub const Elf64_Rela = extern struct {
859862 return @truncate(self.r_info);
860863 }
861864};
865pub const Elf32_Relr = Elf32_Word;
866pub const Elf64_Relr = Elf64_Xword;
862867pub const Elf32_Dyn = extern struct {
863868 d_tag: Elf32_Sword,
864869 d_val: Elf32_Addr,
......@@ -1052,6 +1057,11 @@ pub const Rela = switch (@sizeOf(usize)) {
10521057 8 => Elf64_Rela,
10531058 else => @compileError("expected pointer size of 32 or 64"),
10541059};
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};
10551065pub const Shdr = switch (@sizeOf(usize)) {
10561066 4 => Elf32_Shdr,
10571067 8 => Elf64_Shdr,