aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-24 15:41:22 +0100
committergingerBill <bill@gingerbill.org>2021-05-24 15:41:22 +0100
commitc440296ae8b0f171fc0f7df311831954c9992162 (patch)
tree62ea0c3382eeeb574b74227cd78cfede6571e5ba /src/check_decl.cpp
parent79f115d6a7eed3000a7ca8d40c4a8db2b79dd595 (diff)
Add `@(link_section=<string>)` for global variables
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 0aef40546..323de6d43 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -934,6 +934,9 @@ void check_global_variable_decl(CheckerContext *ctx, Entity *&e, Ast *type_expr,
if (ac.link_name.len > 0) {
e->Variable.link_name = ac.link_name;
}
+ if (ac.link_section.len > 0) {
+ e->Variable.link_section = ac.link_section;
+ }
if (e->Variable.is_foreign || e->Variable.is_export) {
String name = e->token.string;