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

View File

@@ -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;