oridb / mc

Myrddin Compiler
MIT License
389 stars 33 forks source link

Generate per-function ELF sections to enable --gc-sections #156

Closed typeless closed 6 years ago

typeless commented 6 years ago

For GNU assembler only.

A hello-world program saves about 30% (392KB -> 278KB)

oridb commented 6 years ago

We need to test this one on all the supported systems -- I'll get back to you soon. I remember there being something weird about macOS and sections.

typeless commented 6 years ago

You are right, this does not work for MacOS. I'll look into it.

typeless commented 6 years ago

I have no access to macOS right now so I'll test it when I get home or over the weekend.

typeless commented 6 years ago

I have tested it on macOS, make check passes.

oridb commented 6 years ago

Thanks, tested on Linux, FreeBSD, OpenBSD, NetBSD, and OSX. Seems to work.