| author | |
| committer | |
| log | 2a0a11aa6632aa3180ebb1c528b0d1fcb970d5ff |
| tree | d73b4892d277071da3c9daa6675a4483ef621bf2 |
| parent | 0088efc4b22645698faf328369a1deca2dc9070f |
introduce Addr and Half definition to std.elf, and use them for dl_phdr_info2 files changed, 12 insertions(+), 2 deletions(-)
lib/std/elf.zig+10| ... | ... | @@ -937,6 +937,16 @@ pub const Verdaux = switch (@sizeOf(usize)) { |
| 937 | 937 | 8 => Elf64_Verdaux, |
| 938 | 938 | else => @compileError("expected pointer size of 32 or 64"), |
| 939 | 939 | }; |
| 940 | pub const Addr = switch (@sizeOf(usize)) { | |
| 941 | 4 => Elf32_Addr, | |
| 942 | 8 => Elf64_Addr, | |
| 943 | else => @compileError("expected pointer size of 32 or 64"), | |
| 944 | }; | |
| 945 | pub const Half = switch (@sizeOf(usize)) { | |
| 946 | 4 => Elf32_Half, | |
| 947 | 8 => Elf64_Half, | |
| 948 | else => @compileError("expected pointer size of 32 or 64"), | |
| 949 | }; | |
| 940 | 950 | |
| 941 | 951 | /// Machine architectures |
| 942 | 952 | /// See current registered ELF machine architectures at: |
lib/std/os/bits/openbsd.zig+2-2| ... | ... | @@ -33,10 +33,10 @@ pub const Kevent = extern struct { |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | pub const dl_phdr_info = extern struct { |
| 36 | dlpi_addr: usize, | |
| 36 | dlpi_addr: std.elf.Addr, | |
| 37 | 37 | dlpi_name: ?[*:0]const u8, |
| 38 | 38 | dlpi_phdr: [*]std.elf.Phdr, |
| 39 | dlpi_phnum: u16, | |
| 39 | dlpi_phnum: std.elf.Half, | |
| 40 | 40 | }; |
| 41 | 41 | |
| 42 | 42 | pub const Flock = extern struct { |