Skip to content

cbe: linksection not working for function #18023

Description

@clementd64

Zig Version

0.12.0-dev.1637+673a1efa2

Steps to Reproduce and Observed Behavior

exportconst_foolinksection("foo") ="";
exportfnbar() linksection("baz") u32 {
return0;
}
zig build-obj source.zig -ofmt=c

Produce

// ...zig_linksection("foo", uint8_tconst (*const_foo)[1], read) =&__anon_1365;
uint32_tbar(void) {
/* file:2:5 */returnUINT32_C(0);
}

Expected Behavior

Something like

// ...zig_linksection("foo", uint8_tconst (*const_foo)[1], read) =&__anon_1365;
zig_linksection("baz", uint32_t) bar(void) {
/* file:2:5 */returnUINT32_C(0);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend-cThe C backend (CBE) outputs C source code.enhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions