aboutsummaryrefslogtreecommitdiff
path: root/src/checker.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/checker.cpp
parent79f115d6a7eed3000a7ca8d40c4a8db2b79dd595 (diff)
Add `@(link_section=<string>)` for global variables
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 21ca4c398..8f426f116 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -2650,6 +2650,16 @@ DECL_ATTRIBUTE_PROC(var_decl_attribute) {
error(elem, "Expected a string value for '%.*s'", LIT(name));
}
return true;
+ } else if (name == "link_section") {
+ if (ev.kind == ExactValue_String) {
+ ac->link_section = ev.value_string;
+ if (!is_foreign_name_valid(ac->link_section)) {
+ error(elem, "Invalid link section: %.*s", LIT(ac->link_section));
+ }
+ } else {
+ error(elem, "Expected a string value for '%.*s'", LIT(name));
+ }
+ return true;
}
return false;
}