I've started a number of threads on this exact question, search the email
archives if you are interested.
At this point, I have basically given up on using appending linkage for
anything. Instead, the solution I've adopted is a custom linker pass that
stitches globals together in the way that I need them to be. (This would be
easier if I could define my own linkage type - as it stands, I have to rely
on other clues as to which globals to combine together.)
On Thu, Dec 10, 2009 at 8:12 AM, OvermindDL1 <overminddl1 at gmail.com>
wrote:
> On Thu, Dec 10, 2009 at 2:05 AM, Eli Friedman <eli.friedman at
gmail.com>
> wrote:
> > On Thu, Dec 10, 2009 at 12:26 AM, Robin Sommer <robinsommer at
web.de>
> wrote:
> >>
> >> On Sat, Dec 05, 2009 at 22:56 -0800, I wrote:
> >>
> >>> the LLVM documentation lists the 'appending' linkage
for having the
> >>> linker combine two arrays. I'm wondering though if
it's then
> >>> possible to get the size of the combined array, e.g., for
iterating
> >>> over its elements? Or how would I otherwise use the combined
array?
> >>
> >> Any thoughts on this? Am I missing something?
> >
> > Appending linkage isn't really intended for normal code; the most
> > common uses are for special globals, like "llvm.used" and
> > "llvm.global_ctors", which use compiler magic to work
properly.
>
> I know there was talk at one point in the past of a certain thing you
> could setup that appends a zero to the end of that global array so you
> could iterate through it safely, did that ever come about?
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20091210/92eeee9f/attachment.html>