diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-06-29 21:24:00 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-06-29 21:24:00 +0000 |
commit | 207855cff9b4811004b9720f28a5bd0adf3784b7 (patch) | |
tree | 341cb2f4392d2d0af87f4cd7b694a87333c47cc7 /docs | |
parent | 147b7cad2fefa3260e2da8f7cfe31ac07f352ceb (diff) | |
download | external_llvm-207855cff9b4811004b9720f28a5bd0adf3784b7.zip external_llvm-207855cff9b4811004b9720f28a5bd0adf3784b7.tar.gz external_llvm-207855cff9b4811004b9720f28a5bd0adf3784b7.tar.bz2 |
Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:
.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1
This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.html | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index 32f143a..2822813 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -24,6 +24,7 @@ <ol> <li><a href="#linkage_private">'<tt>private</tt>' Linkage</a></li> <li><a href="#linkage_linker_private">'<tt>linker_private</tt>' Linkage</a></li> + <li><a href="#linkage_linker_weak">'<tt>linker_weak</tt>' Linkage</a></li> <li><a href="#linkage_internal">'<tt>internal</tt>' Linkage</a></li> <li><a href="#linkage_available_externally">'<tt>available_externally</tt>' Linkage</a></li> <li><a href="#linkage_linkonce">'<tt>linkonce</tt>' Linkage</a></li> @@ -546,23 +547,27 @@ define i32 @main() { <i>; i32()* </i> <dl> <dt><tt><b><a name="linkage_private">private</a></b></tt></dt> - <dd>Global values with private linkage are only directly accessible by objects - in the current module. In particular, linking code into a module with an - private global value may cause the private to be renamed as necessary to - avoid collisions. Because the symbol is private to the module, all - references can be updated. This doesn't show up in any symbol table in the - object file.</dd> + <dd>Global values with "<tt>private</tt>" linkage are only directly accessible + by objects in the current module. In particular, linking code into a + module with an private global value may cause the private to be renamed as + necessary to avoid collisions. Because the symbol is private to the + module, all references can be updated. This doesn't show up in any symbol + table in the object file.</dd> <dt><tt><b><a name="linkage_linker_private">linker_private</a></b></tt></dt> - <dd>Similar to private, but the symbol is passed through the assembler and - removed by the linker after evaluation. Note that (unlike private - symbols) linker_private symbols are subject to coalescing by the linker: - weak symbols get merged and redefinitions are rejected. However, unlike - normal strong symbols, they are removed by the linker from the final - linked image (executable or dynamic library).</dd> + <dd>Similar to <tt>private</tt>, but the symbol is passed through the + assembler and removed by the linker after evaluation. Note that (unlike + <tt>private</tt> symbols) <tt>linker_private</tt> symbols are subject to + coalescing by the linker: weak symbols get merged and redefinitions are + rejected. However, unlike normal strong symbols, they are removed by the + linker from the final linked image (executable or dynamic library).</dd> + + <dt><tt><b><a name="linkage_linker_weak">linker_weak</a></b></tt></dt> + <dd>Global values with "<tt>linker_weak</tt>" linkage are given weak linkage, + but are removed by the linker after evaluation.</dd> <dt><tt><b><a name="linkage_internal">internal</a></b></tt></dt> - <dd>Similar to private, but the value shows as a local symbol + <dd>Similar to <tt>private</tt>, but the value shows as a local symbol (<tt>STB_LOCAL</tt> in the case of ELF) in the object file. This corresponds to the notion of the '<tt>static</tt>' keyword in C.</dd> |