[cfe-dev] Re-using 'dllexport' for non-Windows targets
Martin J. O'Riordan via cfe-dev
cfe-dev at lists.llvm.org
Sat Jun 4 03:14:14 PDT 2016
Yes it is similar to, though not identical to GOT. Also because we have a non-gas compliant assembler, there is no way of passing GOT information on to the ELF emission. Our compiler does not have an LLVM integrated assembler unfortunately - I'm not even sure I can build an integrated assembler for VLIW with LLVM.
Thanks,
MartinO
-----Original Message-----
From: Rafael Espíndola [mailto:rafael.espindola at gmail.com]
Sent: 31 May 2016 16:44
To: Martin J. O'Riordan <martin.oriordan at movidius.com>
Cc: Saleem Abdulrasool <compnerd at compnerd.org>; Clang Dev <cfe-dev at lists.llvm.org>
Subject: Re: [cfe-dev] Re-using 'dllexport' for non-Windows targets
> 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