Make anonymous namespace as small as possible.

LLVM coding style says that "static" is preferred for file-scope
functions.

Differential Revision: http://reviews.llvm.org/D5323

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@217692 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust lld to handle LLVM r217812

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@217815 91177308-0d34-0410-b5e6-96231b3b80d8
[mach-o] Fix two-level namespace ordinals

On darwin, the linker tools records which dylib (DSO) each undefined was found
in, and then at runtime, the loader (dyld) only looks in that one specific
dylib for each undefined symbol.  Now that llvm-objdump can display that info
I can write test cases.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@217898 91177308-0d34-0410-b5e6-96231b3b80d8
[mach-o] update test case to match new llvm-objdump output

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@217932 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Support TLS callbacks.

The contents from section .CRT$XLA to .CRT$XLZ is an array of function
pointers. They are called by the runtime when a new thread is created
or (gracefully) terminated.

You can make your own initialization function to be called by that
mechanism. All you have to do is:

- Define a pointer to a function in a .CRT$XL* section using pragma
- Make an external reference to "__tls_used" symbol

That technique is used in many projects. This patch is to support that.

What this patch does is to set the relative virtual address of
"__tls_used" to the PECOFF directory table. __tls_used is actually a
struct containing pointers to a symbol in .CRT$XLA and another symbol
in .CRT$XLZ. The runtime looks at the directory table, gets the address
of the struct, and call the function pointers between XLA and XLZ.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@218007 91177308-0d34-0410-b5e6-96231b3b80d8