| author | |
| committer | |
| log | 212715f62d3b22a2da18904f570dbc918ca8470a |
| tree | 0a8fd6af0c4e245ee21795c24cb4860e83b2863c |
| parent | 459ad8c8e6d24d728492bf43d2a00b67db7c3514 |
| signature |
We already have test/cases/pie_linux.zig covering this.3 files changed, 0 insertions(+), 44 deletions(-)
test/standalone/build.zig.zon-3| ... | @@ -139,9 +139,6 @@ | ... | @@ -139,9 +139,6 @@ |
| 139 | .c_embed_path = .{ | 139 | .c_embed_path = .{ |
| 140 | .path = "c_embed_path", | 140 | .path = "c_embed_path", |
| 141 | }, | 141 | }, |
| 142 | .pie = .{ | ||
| 143 | .path = "pie", | ||
| 144 | }, | ||
| 145 | .issue_12706 = .{ | 142 | .issue_12706 = .{ |
| 146 | .path = "issue_12706", | 143 | .path = "issue_12706", |
| 147 | }, | 144 | }, |
test/standalone/pie/build.zig deleted-26| ... | @@ -1,26 +0,0 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | |||
| 3 | pub fn build(b: *std.Build) void { | ||
| 4 | const test_step = b.step("test", "Test it"); | ||
| 5 | b.default_step = test_step; | ||
| 6 | |||
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | ||
| 8 | const target = b.resolveTargetQuery(.{ | ||
| 9 | .os_tag = .linux, | ||
| 10 | .cpu_arch = .x86_64, | ||
| 11 | }); | ||
| 12 | |||
| 13 | const main = b.addTest(.{ | ||
| 14 | .root_module = b.createModule(.{ | ||
| 15 | .root_source_file = b.path("main.zig"), | ||
| 16 | .optimize = optimize, | ||
| 17 | .target = target, | ||
| 18 | }), | ||
| 19 | }); | ||
| 20 | main.pie = true; | ||
| 21 | |||
| 22 | const run = b.addRunArtifact(main); | ||
| 23 | run.skip_foreign_checks = true; | ||
| 24 | |||
| 25 | test_step.dependOn(&run.step); | ||
| 26 | } | ||
test/standalone/pie/main.zig deleted-15| ... | @@ -1,15 +0,0 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | const elf = std.elf; | ||
| 3 | |||
| 4 | threadlocal var foo: u8 = 42; | ||
| 5 | |||
| 6 | test "Check ELF header" { | ||
| 7 | // PIE executables are marked as ET_DYN, regular exes as ET_EXEC. | ||
| 8 | const header = @as(*elf.Ehdr, @ptrFromInt(std.process.getBaseAddress())); | ||
| 9 | try std.testing.expectEqual(elf.ET.DYN, header.e_type); | ||
| 10 | } | ||
| 11 | |||
| 12 | test "TLS is initialized" { | ||
| 13 | // Ensure the TLS is initialized by the startup code. | ||
| 14 | try std.testing.expectEqual(@as(u8, 42), foo); | ||
| 15 | } | ||