Closed as not planned
Description
Summary
When using the -fstrip
flag with zig build-exe
, the exported symbols are removed from the resulting binary, which seems unexpected.
Steps to Reproduce
- Create a file
main.zig
with the following content:export fn foo() void {} pub fn main() void {}
- Run the following command:
zig build-exe main.zig -fstrip
- Attempt to disassemble the
foo
function in the resulting binary:objdump main --disassemble=foo
Observed Behavior
Output
main: file format elf64-x86-64
Disassembly of section .text:
<blank>
The foo
section is not found, indicating that the -fstrip
flag removed the exported symbol.
Expected Behavior
The foo
function, being explicitly marked as export
, should remain accessible in the binary, even when -fstrip
is used
Environment
- Zig version: 0.13.0
- OS: Arch linux x86_64
Additional Note
If this behavior is intentional, clarification in the documentation would be helpful. If not, this might be a bug with -fstrip
implementation.