[cfe-dev] Re-using 'dllexport' for non-Windows targets

Rafael Espíndola via cfe-dev cfe-dev at lists.llvm.org
Tue May 31 08:43:31 PDT 2016


> What I do with the attribute at code-generation is mostly treat it as an
> ordinary symbol, but I supplement their definitions with a set of data
> structures that when linked creates an IAT or Indirect Address Table that
> can be inspected at run-time.  This is useful because the code running on
> the SHAVE cores is usually managed by an executive running on the Sparc Leon
> cores, and the dynamic lookup makes the programming model a lot simpler.
> The additional semantic checks and constraints that CLang places on
> ‘dllexport’ are also very valuable, as they make many incompatible or
> ill-advised use-cases become compile-time errors and warnings.
>
>
>
> In summary, the CLang front-end semantics are very appropriate to my
> requirements, and my LLVM back-end emits normal symbols, but supplemented
> with the auxiliary IAT data structures.
>
>
>
> It would be neat if I could “borrow” the existing ‘dllexport’ implementation
> for the most part, but in a structured well defined manner.  I have had this
> working since LLVM v3.3, but each time I update to a new version I have to
> rework my adaptations, and going forward it would be good to have this
> better integrated using CLang best-practices rather than the ad-hoc I have
> used to date.
>

OK, so the difference is just in clang?

An ELF symbol with default visibility is preemptable already. The IAT
you describe sounds a lot like the got that is used for preemption in
other architectures.

Cheers,
Rafael



More information about the cfe-dev mailing list