aboutsummaryrefslogtreecommitdiff
path: root/lib/std/builtin.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-06-04 21:45:31 -0400
committerAndrew Kelley <andrew@ziglang.org>2025-06-06 23:42:14 -0700
commit0bf8617d963dc432ed0204b10285cc414becf2fd (patch)
treeb4a28f10bd66183cd949e6f0fbb4a786bfc1aa04 /lib/std/builtin.zig
parent178ee8aef1b9f765da916f3e1e4cab66437f8e0a (diff)
downloadzig-0bf8617d963dc432ed0204b10285cc414becf2fd.tar.gz
zig-0bf8617d963dc432ed0204b10285cc414becf2fd.zip
x86_64: add support for pie executables
Diffstat (limited to 'lib/std/builtin.zig')
-rw-r--r--lib/std/builtin.zig15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index 1683cc500b..88e2304332 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -61,7 +61,7 @@ pub const StackTrace = struct {
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
-pub const GlobalLinkage = enum {
+pub const GlobalLinkage = enum(u2) {
internal,
strong,
weak,
@@ -70,7 +70,7 @@ pub const GlobalLinkage = enum {
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
-pub const SymbolVisibility = enum {
+pub const SymbolVisibility = enum(u2) {
default,
hidden,
protected,
@@ -1030,8 +1030,19 @@ pub const ExternOptions = struct {
name: []const u8,
library_name: ?[]const u8 = null,
linkage: GlobalLinkage = .strong,
+ visibility: SymbolVisibility = .default,
+ /// Setting this to `true` makes the `@extern` a runtime value.
is_thread_local: bool = false,
is_dll_import: bool = false,
+ relocation: Relocation = .any,
+
+ pub const Relocation = enum(u1) {
+ /// Any type of relocation is allowed.
+ any,
+ /// A program-counter-relative relocation is required.
+ /// Using this value makes the `@extern` a runtime value.
+ pcrel,
+ };
};
/// This data structure is used by the Zig language code generation and