Commit Graph

710 Commits

Author SHA1 Message Date
Rui Ueyama c4d793f2ad Remove an option starting an uppercase character so that the test does not depends on sort order.
llvm-svn: 189423
2013-08-28 00:01:57 +00:00
Rui Ueyama b5292e6295 Modify test to adopt r189416.
r189416 changed the order of command line options shown in help message,
so the test needs adjusting.

llvm-svn: 189417
2013-08-27 23:48:49 +00:00
Rui Ueyama a372a9b503 Use do-while instead of a magic number. No functionality change.
llvm-svn: 189413
2013-08-27 23:10:26 +00:00
Rui Ueyama 488d41e6ef [PECOFF] Add the entry symbol and /include symbols to dead strip root set.
Differential Revision: http://llvm-reviews.chandlerc.com/D1527

llvm-svn: 189318
2013-08-27 05:15:20 +00:00
Rui Ueyama 8a5cbadff9 Fix use of temporary strings.
llvm-svn: 189310
2013-08-27 04:27:18 +00:00
Rui Ueyama bc839fcd3e [PECOFF] Enable dead-stripping by default to match link.exe behavior.
llvm-svn: 189308
2013-08-27 03:38:18 +00:00
Rui Ueyama 4c3184f3c0 Treat entry point symbol as an undefined atom.
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
2013-08-27 03:18:11 +00:00
Rui Ueyama 352e7308c0 Rename ti -> ctx.
This should have been done in r187823 when I renamed LinkingContext
from TargetInfo. I missed a few files.

llvm-svn: 189298
2013-08-27 00:04:42 +00:00
Rui Ueyama c7ef7a8dd7 [PECOFF] Add Support for entry point symbol name
Patch by Jesús Serrano García.

llvm-svn: 189267
2013-08-26 19:55:09 +00:00
Shankar Easwaran f1947537a0 [lld][ELF] Cleanup ELF writing, No change in functionality
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
2013-08-26 03:16:13 +00:00
Shankar Easwaran da7ceb9b58 [lld][ELF] Indent the td file to < 80 columns
llvm-svn: 189207
2013-08-26 01:56:27 +00:00
Shankar Easwaran 0f2a45cac5 [lld][ELF][Cleanup] Create multiclass for variations in options usage
llvm-svn: 189197
2013-08-25 18:05:15 +00:00
Shankar Easwaran be81dd757e [lld][ELF] process fini_array sections
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
2013-08-25 18:05:12 +00:00
Saleem Abdulrasool 1089265a1d [PECOFF] support additional subsystem identifiers
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
2013-08-24 20:14:54 +00:00
Rui Ueyama 72165ec8c3 Separates /fixed (no .reloc section) and /dynamicbase (enable ASLR)
in order to match link.exe's behaviour.

Patch by Ron Ofir.

llvm-svn: 189159
2013-08-24 00:39:10 +00:00
Hans Wennborg 2391fddfc7 CMake: Support the LLVM_INSTALL_TOOLCHAIN_ONLY flag
llvm-svn: 189157
2013-08-24 00:24:15 +00:00
Rui Ueyama d07c6f06eb Fixes an additional temporary string use.
Patch by Ron Ofir.

llvm-svn: 189151
2013-08-23 22:06:29 +00:00
Tim Northover 274a023d70 Check for "asserts" rather than "debug" on test
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
2013-08-23 21:10:37 +00:00
Shankar Easwaran f9fe6250ff [lld][ELF] Dont ignore zero sized sections.
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
2013-08-23 20:03:35 +00:00
Shankar Easwaran 78457803bc [lld][ELF][Cleanup] Section associated with the relocation traversed
There is no change in functionality, this uses the defined way to access
the relocation section that belongs to a particular section.

llvm-svn: 189138
2013-08-23 20:03:31 +00:00
Shankar Easwaran d9e0a49357 [lld][ELF] Rename typeTLV content type for ELF
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
2013-08-23 20:03:28 +00:00
Shankar Easwaran d17ba4bd4d [lld] handle typeZeroFill atoms in ELF/Native/YAML
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
2013-08-23 20:03:21 +00:00
Hans Wennborg 306db8f3fa CMake: Don't look for llvm-tblgen when building outside LLVM tree
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
2013-08-23 18:18:13 +00:00
Shankar Easwaran 89732e1362 [lld][PECOFF] Fix one more reference to a temporary string
llvm-svn: 189035
2013-08-22 17:59:03 +00:00
Shankar Easwaran c48b9594b6 [lld][PECOFF] Fix use of temporary strings
llvm-svn: 189025
2013-08-22 15:37:09 +00:00
Shankar Easwaran ea68a5d636 [lld][unittests] Change assert to llvm_unreachable
llvm-svn: 189023
2013-08-22 15:23:54 +00:00
Shankar Easwaran 1d76b115a3 [lld][test] fix -Wreturn-type error
llvm-svn: 188988
2013-08-22 05:44:08 +00:00
Shankar Easwaran 5677e433d6 fix build failures on platforms that use -Wunused-private-variable for builds
llvm-svn: 188983
2013-08-22 04:24:57 +00:00
Shankar Easwaran b8b42658ea [lld][Driver] Fix the unit test for lld gnu flavor
llvm-svn: 188982
2013-08-22 03:18:01 +00:00
Shankar Easwaran c1ea4572ba [lld][Hexagon] Enable Hexagon sdata sorting test
llvm-svn: 188981
2013-08-22 03:02:17 +00:00
Shankar Easwaran 88d0d44635 [lld] Fix unused private fields for fixing build failure on darwin
llvm-svn: 188978
2013-08-22 01:49:16 +00:00
Shankar Easwaran b4fae7c3d0 remove trailing whitespace
llvm-svn: 188965
2013-08-22 00:08:25 +00:00
Shankar Easwaran 2032609327 [lld][Darwin] fixing an accidentally removed change
llvm-svn: 188963
2013-08-21 23:31:58 +00:00
Shankar Easwaran c4dba32d19 [lld] Fix win7 failure on adding InputGraph functionality
llvm-svn: 188961
2013-08-21 23:13:22 +00:00
Shankar Easwaran e44104b001 add InputGraph functionality
llvm-svn: 188958
2013-08-21 22:57:10 +00:00
Hans Wennborg 04632f1f16 [PECOFF] Handle "--" option explicitly
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
2013-08-13 21:44:44 +00:00
Rui Ueyama 8432d32c67 [PECOFF] Treat the common symbol as mergeable symbol.
This is a temporary measure because the semantics of the common symbol is
actually more compilcated than the simple mergeable symbol.

llvm-svn: 188235
2013-08-13 00:03:21 +00:00
Rui Ueyama 43e5fd224a [PECOFF] Fixed base images now have the IMAGE_FILE_RELOCS_STRIPPED flag
Patch by Ron Ofir.

llvm-svn: 188187
2013-08-12 18:11:35 +00:00
Rui Ueyama f1ffe8abbf [PECOFF] Trim at most one character from imported symbols.
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
2013-08-12 04:10:00 +00:00
Rui Ueyama 2db270c895 Revert r188150 to un-break the buildbot.
llvm-svn: 188152
2013-08-12 03:02:23 +00:00
Rui Ueyama bf5610cced [PECOFF] It's an error if subsystem is not specified.
llvm-svn: 188150
2013-08-12 02:23:16 +00:00
Daniel Dunbar bc7bfb1bee [tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188093
2013-08-09 18:51:17 +00:00
Rui Ueyama bae7f8ee2d [PECOFF] Add a note about underscore symbol prefix.
llvm-svn: 188090
2013-08-09 18:34:57 +00:00
Rui Ueyama 908606d0a9 [PECOFF] Create __ImageBase symbol.
__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
2013-08-09 04:44:15 +00:00
Rui Ueyama 02d0bf0f80 Fix spelling error. s/Libary/Library/g.
llvm-svn: 188049
2013-08-09 04:19:54 +00:00
Rui Ueyama d7414e25da [PECOFF] Fully cover the switch for COMDAT attributes and add a comment.
llvm-svn: 188046
2013-08-09 01:06:21 +00:00
Rui Ueyama 6427ae8ae6 Fix comment typo.
llvm-svn: 188045
2013-08-09 01:06:19 +00:00
Rui Ueyama dd72278fea [PECOFF] Support COMDAT section that contains mergeable atoms.
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
2013-08-08 23:31:50 +00:00
Michael J. Spencer 238cc72ec5 Update to llvm changes.
llvm-svn: 188021
2013-08-08 22:26:50 +00:00
Rui Ueyama a05adfaa90 Update the .drectve section to remove reference to nonexistent files.
llvm-svn: 188011
2013-08-08 21:04:09 +00:00