Add @(link_section=<string>) for global variables

This commit is contained in:
gingerBill
2021-05-24 15:41:22 +01:00
parent 79f115d6a7
commit c440296ae8
5 changed files with 18 additions and 0 deletions
+10
View File
@@ -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;
}