With this patch the entry symbol is treated as an undefined symbol, to force
the resolver to resolve the entry symbol.
Differential Revision: http://llvm-reviews.chandlerc.com/D1524
llvm-svn: 189307
The cleanup includes :-
* Rename ambiguous Header class to ELFHeader
* Convert Chunk contentype and kind to be a enumerated class
* Remove functions that are not being used, avoids future confusion
llvm-svn: 189209
This change processes fini_array section in addition to processing
init_array sections. This also makes functions registered at compile
time for initialization and finalization to be run during execution
llvm-svn: 189196
This completes the subsystem name parsing to support the identifiers that the
Microsoft link.exe linker supports. "windows" and "console" are left as the
first items as they are the expected common paths.
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 189181
The debug flag being checked for seems to be controlled by whether the
build is asserts/non-asserts rather than debug/non-debug. Mostly these
correlate, but not necessarily.
As far as I can tell with various combinations of debug/assetions this
change makes no difference on autotools builds, but fixes a check-all
failure with CMake.
llvm-svn: 189147
There may be relocations that may be pointing to the section
even if the section sizes are 0. We shouldnot ignore them
for that regard.
llvm-svn: 189139
typeTLV content type is used by Darwin to represent thread local
storage. A new contentType has to be made to represent ELF
thread local storage data. These have been set to
- typeThreadZeroFill (represents TBSS storage)
- typeThreadData (represents TDATA storage)
llvm-svn: 189137
BSS atoms dont take any file space in the Input file. They are associated
with a contentType(typeZeroFill). Similiar zero fill types also exist which
have the same meaning in terms of occupying file space in the Input.
These atoms have to be handled seperately when writing to the
lld's intermediate file or the lld test infrastructure.
Also adds a test.
llvm-svn: 189136
Previously, the CMake build would look for llvm-tblgen to determine
if a directory is an LLVM build or install directory. Since we don't
want to include llvm-tblgen in the install, look for llvm-config instead,
and use that to find llvm-tblgen.
(This is the lld equivalent of Clang r189127.)
llvm-svn: 189128
This used to be handled automagically by the option parsing library,
but after LLVM r188314, we should handle it ourselves.
No functionality change, but adds a test.
llvm-svn: 188318
The import name is not always the same as the symbol name. If the name/type
field in the import header is NOPREFIX or UNDECORATE, we need to strip some
characters from symbol to get its import name.
The Microsoft PE/COFF spec is vague if symbol contains more than two
consecutive characters to be stripped. We used to strip all characters,
but it doesn't seem right as we couldn't link against the system library
because of this name mangling. Looks like we shouldn't strip more than one
character.
llvm-svn: 188154
__ImageBase is a symbol having 4 byte integer equal to the image base address
of the resultant executable. The linker is expected to create the symbol as if
it were read from a file.
In order to emit the symbol contents only when the symbol is actually
referenced, we created a pseudo library file to wrap the linker generated
symbol. The library file member is emitted to the output only when the member
is actually referenced, which is suitable for our purpose.
llvm-svn: 188052
The COMDAT section is a section with a special attribute to tell the linker
whether the symbols in the section are allowed to be merged or not. This patch
add a function to interpret the COMDAT data and set "merge" attribute to the
atoms accordingly.
LLD supports multiple policies to merge atoms; atoms can be merged by name or
by content. COFF supports them, and in addition to that, it supports
choose-the-largest-atom policy, which LLD currently does not support. I simply
mapped it to merge-by-name attribute for now, but we eventually have to support
that policy in the core linker.
llvm-svn: 188025