Supporting Dynamic Linking

Robbert Haarman <>
Sun, 21 Nov 2010 18:37:22 +0100

          From comp.compilers

Related articles
Supporting Dynamic Linking (Robbert Haarman) (2010-11-21)
Re: Supporting Dynamic Linking (Ian Lance Taylor) (2010-11-22)
| List of all articles for this month |

From: Robbert Haarman <>
Newsgroups: comp.compilers,comp.lang.misc
Date: Sun, 21 Nov 2010 18:37:22 +0100
Organization: Wanadoo
Keywords: code, linker, question
Posted-Date: 21 Nov 2010 23:06:30 EST

Hi everyone!

One of the features I am currently working on for Voodoo is making
currently being worked on is making the Voodoo compiler emit code
suitable for use in dynamic libraries. The main impediment here is that
the linker likes to know the size of objects in a dynamic library, but
Voodoo does not currently provide this information. For example, if one

section data

word 0
word 1

word 2

What is the size that should be reported to the linker for some_label?
Perhaps it is one word. Perhaps two. Perhaps another_label is actually
inside the object that starts at some_label, and the size is actually
3 words. Perhaps it is yet another value. One way to resolve this
would be to surround the part that is to be exported by a data ... end data
block, i.e.

word 0
word 1
end data

would make clear that there are two words in the object that starts at
some_label. Perhaps there should also be a default case; for example,
if no data ... end data block is provided, only the first byte/word/string
after the label is exported.

I would appreciate knowing people's thoughts on this matter. How has
this been solved before? Are any of these solutions particularly suitable
for Voodoo, keeping in mind Voodoo's purpose of combining staying
close to the hardware level with being portable to different architectures?

Kind regards,


Give a man a fish and he will eat for a day. Teach a man to fish and he
will eat for a lifetime.
-- Confucius

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.