-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.14.0
Steps to Reproduce and Observed Behavior
@export(.{.section = "foo" } is ignored when used on functions
Simple repro:
pub fn _entry_point() callconv(.c) void {
asm volatile (
\\str r0, [r1]
);
}
comptime {
@export(&_entry_point, .{
.name = "_entry_point",
.section = ".hello",
});
}
> zig build-obj -target thumb-freestanding -mcpu cortex_m0 main.zig -OReleaseFast
> llvm-objdump -d ~/main.o
main.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <_entry_point>:
0: 6008 str r0, [r1]
2: 4770 bx lr
Expected Behavior
@export should respect the .section field for function pointers or throw an error when both .section and function pointers are passed to it
Grazfather, arkadiuszwojcik, ghostiam, patryk4815, BratishkaErik and 3 more
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior