Page MenuHomePhabricator

Export public functions implemented in assembly on Windows.
ClosedPublic

Authored by cdavis5x on Aug 30 2018, 2:38 PM.

Details

Summary

By default, symbols aren't visible outside of the module that defines
them. To make them visible, they must be exported. The easiest way to do
that is to embed an -export:symname directive into the object file.

Diff Detail

Repository
rL LLVM

Event Timeline

cdavis5x created this revision.Aug 30 2018, 2:38 PM
rnk added inline comments.Aug 30 2018, 2:55 PM
src/assembly.h
76–78 ↗(On Diff #163414)

Maybe .pushsection / .popsection is better than assuming you were in .text.

cdavis5x added inline comments.Aug 31 2018, 6:56 AM
src/assembly.h
76–78 ↗(On Diff #163414)

I initially wanted to do that, but those directives aren't supported by COFF. Neither, by the way, is .previous. Perhaps this needs to be fixed in LLVM.

rnk accepted this revision.Aug 31 2018, 11:09 AM

lgtm

src/assembly.h
76–78 ↗(On Diff #163414)

Huh, I guess neither does gas. .text is fine then. I'll file a bug to implement those directives for COFF. They're pretty handy, especially for an object file format that uses comdat sections so frequently.

This revision is now accepted and ready to land.Aug 31 2018, 11:09 AM
This revision was automatically updated to reflect the committed changes.