[LLVMdev] Linkages handling

Vladimir Prus ghost at cs.msu.su
Fri Jun 18 09:49:01 PDT 2004


Hello,
looking at Printer::doFinalization, I have some question about support of the 
different linkages. Here's a table of how that method handles the possible 
combinations: 

                                 Initialized                Null
Internal                      .data, local              .data, .comm, .local
External                     .data, .globl             .bss, .globl, 
Appending                 ???                         ????
LinkOnce                   llvm.linkonce.d          data, .comm
	                         .weak
Weak                        ???                         ???

And the question I have are:

1. Does ld really supports appending linkage?
2. The difference between LLVM linkonce and weak is that linkone symbols can 
be discared, if not used. I don't think there's anything in ld which matches 
LLVM linkonce -- the symbols are never discarded. Am I wrong?
3. I've tries to figure out how linkonce works with ld. It appears that it 
special cases sections starting with ".gnu.linkonce". In other words, naming 
a spection "llvm.linkonce.d" has no effect. Is it true?
4. Can internal null-initialized data be placed in the ".bss" section, instead 
of '.data' with '.comm' attribute, as is done now?
5. Can linkonce null-initialized data be placed in the ".data" section, with 
the ".weak" attribute, instead of ".comm" attribute. 


- Volodya




More information about the llvm-dev mailing list