Commit Graph

676 Commits

Author SHA1 Message Date
Simon Atanasyan bcb865a8ce [Mips] Replace assembler code by YAML to make the 'entry-name.test' test target
independent.

llvm-svn: 213690
2014-07-22 21:47:34 +00:00
Nick Kledzik e1aaced0cb [mach-o] Add test case for armv6 (arm not thumb) hello world
llvm-svn: 213592
2014-07-22 00:49:49 +00:00
Nick Kledzik 03e16f2ab4 [mach-o] add support for old x86 __eh_frame sections
Over time the symbols and relocations have changed for dwarf unwind info
in the __eh_frame section.  Add test cases for older and new style.

llvm-svn: 213585
2014-07-21 22:06:57 +00:00
Simon Atanasyan 09f45ca39b [Mips] Replace assembler code by YAML to make the 'dynlib-fileheader.test'
test target independent.

llvm-svn: 213480
2014-07-20 20:03:46 +00:00
Simon Atanasyan 5ecadda642 [Mips] Replace assembler code by YAML to make the test 'dynlib-dynamic.test'
target independent.

llvm-svn: 213462
2014-07-19 20:18:46 +00:00
Simon Atanasyan f7ce3ea024 [Mips] Replace assembler code by YAML to make the test 'base-address.test'
target independent.

llvm-svn: 213390
2014-07-18 17:23:21 +00:00
Nick Kledzik 7e246a47f9 [mach-o] Add support for x86 pointers which use scattered relocations
llvm-svn: 213344
2014-07-18 01:05:35 +00:00
Nick Kledzik 68a1abdf14 [mach-o] Add support for x86 CALL instruction that uses a scattered relocation
llvm-svn: 213340
2014-07-18 00:37:52 +00:00
Nick Kledzik 2d432353ba [mach-o] implement more x86 and x86_64 relocation support
Add support for adding section relocations in -r mode.  Enhance the test
cases which validate the parsing of .o files to also round trip.  They now
write out the .o file and then parse that, verifying all relocations survived
the round trip.

llvm-svn: 213333
2014-07-17 23:16:21 +00:00
Rui Ueyama 286691ad5e [PECOFF] Set DLL bit in PE header if DLL.
Windows loader can load a DLL without this bit but it wouldn't
call the initializer function in the DLL if the bit is absent.

llvm-svn: 213216
2014-07-17 00:22:26 +00:00
Nick Kledzik 2458bec7e7 [mach-o] refactor KindHandler into ArchHandler and simplify passes.
All architecture specific handling is now done in the appropriate
ArchHandler subclass.

The StubsPass and GOTPass have been simplified.  All architecture specific
variations in stubs are now encoded in a table which is vended by the
current ArchHandler.

llvm-svn: 213187
2014-07-16 19:49:02 +00:00
Simon Atanasyan 64c0ac2b35 [ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command.
There are two forms of `-l` prefixed expression:

* -l<libname>
* -l:<filename>

In the first case a linker should construct a full library name
`lib + libname + .[so|a]` and search this library as usual. In the second case
a linker should use the `<filename>` as is and search this file through library
search directories.

The patch reviewed by Shankar Easwaran.

llvm-svn: 213077
2014-07-15 17:17:30 +00:00
Simon Atanasyan 35ad71adad [Mips] Fix test case expectations due the latest changes in the LLVM.
llvm-svn: 212949
2014-07-14 15:31:47 +00:00
Simon Atanasyan 355f7ed602 [Mips] Remove unused test input file.
llvm-svn: 212927
2014-07-14 08:54:40 +00:00
Simon Atanasyan c97126b1c9 [Mips] Make rel-dynamic-11.test test case independent from external input files.
llvm-svn: 212813
2014-07-11 13:42:04 +00:00
Rui Ueyama 8cb0f1e3c0 [PECOFF] Set resource table entry in header.
The resource table entry should have the RVA of the
embedded resource file.

llvm-svn: 212765
2014-07-10 21:43:19 +00:00
Rui Ueyama 31fd9d09b2 [PECOFF] Invoke cvtres.exe in the driver.
Previously we invoked cvtres.exe for each compiled Windows
resource file. The generated files were then concatenated
and embedded to the executable.

That was not the correct way to merge compiled Windows
resource files. If you just concatenate generated files,
only the first file would be recognized and the rest would
be ignored as trailing garbage.

The right way to merge them is to call cvtres.exe with
multiple input files. In this patch we do that in the
Windows driver.

llvm-svn: 212763
2014-07-10 20:53:37 +00:00
Simon Atanasyan d092f0e64a [Mips] Make rel-dynamic-10.test test case independent from external input files.
llvm-svn: 212758
2014-07-10 19:47:23 +00:00
Tim Northover 73c532e8a9 [mach-o]: support -Z option to skip standard library paths
llvm-svn: 212713
2014-07-10 11:46:13 +00:00
Tim Northover 18af0573df [mach-o]: support user-specified (-L) library search paths
llvm-svn: 212712
2014-07-10 11:46:08 +00:00
Tim Northover 77d82202d1 [mach-o]: support -syslibroot and -l options
These behave slightly idiosyncratically in the best of cases, and have
additional hacks layered on top of that for compatibility with badly behaved
build systems (via ld64).

For -lXYZ:
  + If XYZ is actually XY.o then search all library paths for XY.o
  + Otherwise search all library paths, first for libXYZ.dylib, then libXYZ.a
  + By default the library paths are /usr/lib and /usr/local/lib in that order.

For -syslibroot:
  + -syslibroot options apply to absolute paths in the search order.
  + All -syslibroot prefixes that exist are added to the search path *instead*
    of the original.
  + If no -syslibroot prefixed path exists, the original is kept.
  + Hacks^WExceptions:
      + If only 1 -syslibroot is given and doesn't contain /usr/lib or
        /usr/local/lib, that path is dropped entirely. (rdar://problem/6438270).
      + If the last -syslibroot is "/", all of them are ignored entirely.
        (rdar://problem/5829579).

At least, that's my best interpretation of what ld64 does in buildSearchPaths.

llvm-svn: 212706
2014-07-10 11:21:06 +00:00
Nick Kledzik 0edfdeb0be Move GOTPass and StubsPass from Core to MachO
llvm-svn: 212652
2014-07-09 21:04:24 +00:00
Simon Atanasyan 0acd5447b4 [Mips] Make rel-dynamic-08.test test case independent from external input files.
llvm-svn: 212613
2014-07-09 12:31:11 +00:00
Nick Kledzik 2552a09978 Change llvm-nm to use -M instead of -s to work with latest llvm-nm
llvm-svn: 212579
2014-07-09 00:25:52 +00:00
Rui Ueyama 39dc40af07 [PECOFF] Fix .bss section alignment
Previously the alignment of the .bss section was not
properly set because of a bug in AtomizeDefinedSymbolsInSection.
We set the alignment of the section at the end of the function,
but we use an eraly return for the .bss section, so the code had
been skipped.

llvm-svn: 212571
2014-07-08 23:11:01 +00:00
Simon Atanasyan e693e8f8f0 [Mips] Make rel-dynamic-07.test test case independent from external input files.
llvm-svn: 212542
2014-07-08 15:47:55 +00:00
Simon Atanasyan 49eafe909b [Mips] Make rel-dynamic-05.test test case independent from external input files.
llvm-svn: 212480
2014-07-07 20:14:49 +00:00
Simon Atanasyan 611b7a11b5 [Mips] Make rel-dynamic-04.test test case independent from external input files.
llvm-svn: 212409
2014-07-06 17:44:40 +00:00
Nick Kledzik 4576c115ac [mach-o] Add parsing of arm/thumb relocations
This converts the very complicated mach-o arm
relocations into the simple Reference Kinds in lld.

The next patch will use the internal Reference kinds
to fix up arm/thumb code.

llvm-svn: 212306
2014-07-04 00:11:09 +00:00
Tim Northover ca2e63daf8 [mach-o]: remove dylib install-name test with a.out
Unfortunately, the creation of (the default) output file, a.out races with all
the other tests in this directory. When the wrong one is read by macho-dump,
the test fails.

llvm-svn: 212269
2014-07-03 12:50:23 +00:00
Nick Kledzik b6e8ce8250 [mach-o] add x86 test case to build hello world. Fix bugs it uncovered.
llvm-svn: 212247
2014-07-03 02:01:21 +00:00
Nick Kledzik de0860aae4 [mach-o] add parsing of x86 relocations
llvm-svn: 212239
2014-07-02 23:52:22 +00:00
Rui Ueyama 408d4d470d Add missing dependency to macho-dump.
r212094 added a few tests that use macho-dump.

llvm-svn: 212200
2014-07-02 18:16:31 +00:00
Tim Northover 9bdf90e5c2 [mach-o]: make the default dylib install-name the output filename.
llvm-svn: 212094
2014-07-01 08:41:45 +00:00
Tim Northover 301c4e690a [mach-o] add representation for LC_ID_DYLIB to MachONormalizedFile
It still needs to be tied into BinaryReader, but this allows reasonably
sensible creation of SharedLibrary atoms on MachO.

llvm-svn: 212093
2014-07-01 08:15:41 +00:00
Nick Kledzik 378066c80e [mach-o] improve errors when mixing architectures
llvm-svn: 212072
2014-06-30 22:57:33 +00:00
Tim Northover b5bf686b58 MachO: stop iterating past the end of an array
When trying to map atom types to sections, we were iterating through an array
until we hit a sentinel value. There's no need for such dances when range-based
for loops are available.

llvm-svn: 212035
2014-06-30 10:30:00 +00:00
Tim Northover 9ee9935358 MachO: re-enable writing of compact-unwind sections.
This isn't really the right place to put them in final object files (that would
be __TEXT,__unwind_info), but the format is different between relocatable and
final objects, which means we really need a pass to handle the translation.

For now, re-emitting in __LD,__compact_unwind is harmless (dyld ignores it and
moves straight on to inspecting __TEXT,__eh_frame), and sidesteps an assertion
failure when processing files containing compact-unwind info.

llvm-svn: 212032
2014-06-30 09:49:37 +00:00
Tim Northover 7b0a1306b4 MachO: align segment virtual addresses to page size.
Segments must occupy a multiple of the page size in memory (4096 currently). We
check for this when emitting files, but the placement algorithm broke down for
the second non-__TEXT segment encountered: the offset wasn't aligned up to 4096
before starting its layout.

llvm-svn: 212031
2014-06-30 09:49:33 +00:00
Tim Northover 08d6a7bfef MachO: calculate segment offsets in final MachO files properly.
Because of how we were calculating fileOffset and fileSize for segments, most
ended up at a single offset in a finalised MachO file. This meant the data
often didn't even get written in the final object, let alone where it would be
useful.

llvm-svn: 212030
2014-06-30 09:49:30 +00:00
Tim Northover f9b13d6766 MachO: support atomization of dylibs.
For .dylib files, we refrain from actually creating any atoms until they're
requested via the "exports" method.

llvm-svn: 212027
2014-06-30 09:11:38 +00:00
Nick Kledzik 3f69076278 [mach-o] refactor x86_64 relocation handling.
This is first step in reworking how mach-o relocations are processed.
The existing KindHandler is going to become a delgate/helper object for
processing architecture specific references.  The KindHandler knows how
to convert mach-o relocations into References and back, as well, as fixing
up the content the relocation is on.

One of the messy things about mach-o relocations is that they sometime 
come in pairs, but the pairs still convert to one lld::Reference. So, the
conversion has to detect pairs (arch specific) and change the stride.

llvm-svn: 211921
2014-06-27 18:25:01 +00:00
Simon Atanasyan 65e2464667 [Driver] Improve the `isPathUnderSysroot()` function. Now it returns a
correct result even if checking paths: a) symlinks and/or b) contains relative
parts like /dir1/dir2/../dir2.

llvm-svn: 211772
2014-06-26 10:48:52 +00:00
Tim Northover f48f0620ed [mach-o]: atomize zero-terminated literals correctly.
When looking through sections with zero-terminated string-literals (__cstring
or __ustring) we were constantly rechecking the first few bytes of the string
for '\0' rather than advancing along. This obviously failed unless all strings
within the section had the same length as that first one.

llvm-svn: 211682
2014-06-25 11:21:51 +00:00
Tim Northover 36bd9ab2c5 [mach-o] don't assume all sections have symbols
We were trying to examine the first symbol in a section that we wanted to
atomize by symbols, even when there wasn't one. Instead, we should make the
initial anonymous symbol cover the entire section in that situation.

llvm-svn: 211681
2014-06-25 10:59:37 +00:00
Simon Atanasyan d449fc8671 [ELF] Add two new virtual functions to the `OutputELFWriter` class to control
dynamic symbol table populating and DT_NEEDED tag creation.

The `isDynSymEntryRequired` function returns true if the specified shared
library atom requires a dynamic symbol table entry. The `isNeededTagRequired`
function returns true if we need to create DT_NEEDED tag for the shared
library defined specified shared atom.

By default the both functions return true. So there is no functional changes
for all targets except MIPS. Probably we need to spread the same modifications
on other ELF targets but I want to implement and fully tested complete set of
changes for MIPS target first.

For MIPS we create a dynamic symbol table entry for a shared library atom iif
this atom is referenced by a regular defined atom. For example, if library L1
defines symbol T1, library L2 defines symbol T2 and uses symbol T1
and executable file E1 uses symbol T2 but does not use symbol T1 we create
an entry in the E1 dynamic symbol table for symbol T2 and do not create
an entry for T1.

The patch creates DT_NEEDED tags for shared libraries contain shared library
atoms which a) referenced by regular defined atoms; b) have corresponding
copy dynamic relocations (R_MIPS_COPY).

Now the patch does not take in account --as-needed / --no-as-needed command
line options. So it is too restrictive and create DT_NEEDED tags for really
needed shared libraries only. I plan to fix that by subsequent patches.

llvm-svn: 211674
2014-06-25 07:55:55 +00:00
Simon Atanasyan 3b8c86b985 [Mips] Make rel-dynamic-03.test test case independent from external input files.
llvm-svn: 211491
2014-06-23 12:28:11 +00:00
Simon Atanasyan b1032ad260 [Mips] Make rel-dynamic-01.test test case independent from external input files.
llvm-svn: 211463
2014-06-22 11:58:08 +00:00
Simon Atanasyan e8a2875774 [Mips] Make rel-copy.test test case independent from external input files.
llvm-svn: 211355
2014-06-20 12:54:06 +00:00
Simon Atanasyan 825c5992d8 [Mips] Make r26-1.test test case independent from external input files.
llvm-svn: 211263
2014-06-19 10:18:58 +00:00
Rui Ueyama 61d7f97000 [PECOFF] Support COMDAT associative sections.
COFF supports a feature similar to ELF's section groups. This
patch implements it.

In ELF, section groups are identified by their names, and they are
treated somewhat differently from regular symbols. In COFF, the
feature is realized in a more straightforward way. A section can
have an annotation saying "if Nth section is linked, link this
section too."

I added a new reference type, kindAssociate. If a target atom is
coalesced away, the referring atom is removed by Resolver, so that
they are treated as a group.

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

llvm-svn: 211106
2014-06-17 16:19:33 +00:00
Simon Atanasyan e5b03cb790 [Mips] Make plt-header.test test case independent from external input files.
llvm-svn: 211099
2014-06-17 13:08:11 +00:00
Simon Atanasyan 0469dbd43f [Mips] Make hilo16-5.test test case independent from external input files.
llvm-svn: 211017
2014-06-16 11:54:42 +00:00
Simon Atanasyan 004c49b017 [Mips] Make gp-sym-2.test test case independent from external input files.
llvm-svn: 210987
2014-06-15 12:04:40 +00:00
Simon Atanasyan 2e67be3cc2 [Mips] Make gp-sym-1.test test case independent from external input files.
llvm-svn: 210981
2014-06-14 21:18:50 +00:00
Simon Atanasyan 4156ac2ecd [Mips] Make exe-got.test test case independent from external input files.
llvm-svn: 210977
2014-06-14 12:55:03 +00:00
Simon Atanasyan f0f8207995 [Mips] Make exe-fileheader.test test case independent from external input files.
llvm-svn: 210893
2014-06-13 11:44:23 +00:00
Simon Atanasyan 033ecd1cc8 [Mips] Make exe-dynamic.test test case independent from external input files.
llvm-svn: 210796
2014-06-12 16:46:47 +00:00
Rui Ueyama 8ab4e2ce25 group-cmd-search test is not supposed to pass on Windows.
llvm-svn: 210697
2014-06-11 20:00:22 +00:00
Simon Atanasyan 87a06716e6 [Mips] Fix the bug -- symbol referred by the R_MIPS_TLS_GD relocation
does not get an entry in the dynamic symbol table.

llvm-svn: 210648
2014-06-11 10:08:08 +00:00
Nick Kledzik 936d5205bb [mach-o] fix use of resolver functions to not cause duplicate sections.
The previous commit uncovered a bug in the mach-o writer whereby two __text
sections were created.  But the test case did not catch that.  So I updated
the test case to run the linker a second time, reading the output of the
first pass.  

llvm-svn: 210624
2014-06-11 01:30:55 +00:00
Nick Kledzik 6085539bed [mach-o] add support for parsing resolver functions
llvm-svn: 210612
2014-06-11 00:24:16 +00:00
Simon Atanasyan 6790b14ebb [ELF] Fix the bug -- LLD crashes if the --whole-archive option
is around non-archive.

llvm-svn: 210530
2014-06-10 13:43:13 +00:00
Nick Kledzik b423266e93 [mach-o] parse multiple symbols on same address into aliases
llvm-svn: 210502
2014-06-09 23:35:37 +00:00
Simon Atanasyan 1de1d63aec [Mips] Make dt-textrel.test test case independent from external input files.
llvm-svn: 210469
2014-06-09 13:45:58 +00:00
Rui Ueyama c97b661475 Re-commit r210425.
llvm-svn: 210456
2014-06-09 08:57:37 +00:00
Rui Ueyama 8708a0ea7e Add missing dependency for check-lld.
llvm-svn: 210455
2014-06-09 08:42:38 +00:00
Rui Ueyama 2ad8c22a55 Revert "[Mips] Make got16.test test case independent from external input files."
This reverts commit r210425 because the test added in the commit
is broken.

llvm-svn: 210451
2014-06-09 08:23:58 +00:00
Simon Atanasyan 8804e5cb49 [Mips] Make got16.test test case independent from external input files.
llvm-svn: 210425
2014-06-08 11:33:05 +00:00
Simon Atanasyan c8e86fb032 [Mips] Handle Mips TLS relocations R_MIPS_TLS_GOTTPREL / R_MIPS_TLS_GD / R_MIPS_TLS_LDM etc.
llvm-svn: 210394
2014-06-07 13:20:53 +00:00
Simon Atanasyan 8065fb761e [Mips] Make dynlib-dynsym.test self contained.
llvm-svn: 210258
2014-06-05 12:39:12 +00:00
Rui Ueyama 0291dd2c8a Revert "[PECOFF] Support COMDAT associative sections."
This reverts accidental commit r210240.

llvm-svn: 210243
2014-06-05 07:40:59 +00:00
Rui Ueyama f3cb9d1d57 [PECOFF] Support COMDAT associative sections.
COFF supports a feature similar to ELF's section groups. This
patch implements it.

In ELF, section groups are identified by their names, and they are
treated somewhat differently from regular symbols. In COFF, the
feature is realized in a more straightforward way. A section can
have an annotation saying "if Nth section is linked, link this
section too."

Implementing such feature is easy. We can add a reference from a
target atom to an original atom, so that if the target is linked,
the original atom is also linked. If not linked, both will be
dead-stripped. So they are treated as a group.

I added a new reference type, kindAssociate. It does nothing except
preventing referenced atoms from being dead-stripped.

No change to the Resolver is needed.

Reviewers: Bigcheese, shankarke, atanasyan

Subscribers: llvm-commits

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

llvm-svn: 210240
2014-06-05 07:37:20 +00:00
Iain Sandoe c4d9bedcfc Initial set of Makefiles
This provides support for the autoconfing & make build style.
The format, style and implementation follows that used within the llvm and clang projects.

TODO: implement out-of-source documentation builds.
llvm-svn: 210177
2014-06-04 09:54:07 +00:00
Nick Kledzik a2d602560b [mach-o] Make anonymous atom out of section content before any symbol
In sections that are broken into atoms at symbols, if the first symbol in the
section is not at the start of the section, then make an anonymous atom for
the section content that is before the first symbol.

llvm-svn: 210142
2014-06-04 00:34:27 +00:00
Nick Kledzik cb9f890b77 [mach-o] Refactor sections -> atoms to be table driven.
Previously each section kind had its own code to loop over the section and
parse it into atoms.  This refactoring has two tables.  The first maps sections
to ContentType.  The second maps ContentType to information on how to find 
the atom boundaries.  

A few bugs in test cases were discovered as part of the refactoring.  
No change in functionality intended.

llvm-svn: 210138
2014-06-03 23:36:50 +00:00
Simon Atanasyan fd5b2346cc [Mips] Make la25-stub.test self contained.
No functional changes.

llvm-svn: 210094
2014-06-03 09:59:42 +00:00
Rui Ueyama 9aee050a0c Remove group-parent references.
Previously section groups are doubly linked to their children.
That is, an atom representing a group has group-child references
to its group contents, and content atoms also have group-parent
references to the group atom. That relationship was invariant;
if X has a group-child edge to Y, Y must have a group-parent
edge to X.

However we were not using group-parent references at all. The
resolver only needs group-child edges.

This patch simplifies the section group by removing the unused
reverse edge. No functionality change intended.

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

llvm-svn: 210066
2014-06-03 03:07:49 +00:00
Rui Ueyama 23487e878b Make dead-striping to handle reverse edges.
Layout-before edges are no longer used for layout, but they are
still there for dead-stripping. If we would just remove them
from code, LLD would wrongly remove live atoms that were
referenced by layout-befores.

This patch fixes the issue. Before dead-stripping, it scans all
atoms to construct a reverse map for layout-after edges. Dead-
stripping pass uses the map to traverse the graph.

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

llvm-svn: 210057
2014-06-03 01:59:02 +00:00
Simon Atanasyan 2c2486446c [Mips] Reduce number of input files used my Mips tests.
No functional changes.

llvm-svn: 210004
2014-06-02 04:20:01 +00:00
Simon Atanasyan b635d04589 [Mips] Implement .{ctors,dtors}.<priority> sections ordering.
Arrange .ctors/.dtors sections in the following order:
  .ctors from crtbegin.o or crtbegin?.o
  .ctors from regular object files
  .ctors.* (sorted) from regular object files
  .ctors from crtend.o or crtend?.o

This order is specific for MIPS traget. For example, on X86
the .ctors.* sections are merged into the .init_array section.

llvm-svn: 209987
2014-06-01 06:28:42 +00:00
Nick Kledzik acfad80250 [mach-o] Add support for custom sections
llvm-svn: 209928
2014-05-30 22:51:04 +00:00
Simon Atanasyan 2aae2b4609 [ELF] Fix incorrect sorting of .init_array / .fini_array sections.
The main problem is in the predicate passed to the `std::stable_sort()`.
This predicate always returns false if **both** section's names do not
start with `.init_array` or `.fini_array` prefixes. In short, it does not
define a strict weak orderng. Suppose we have the following sections:

  .A .init_array.1 .init_array.2

The predicate states that:

  not .init_array.1 < .A
  not .A < .init_array.2
  but .init_array.1 < .init_array.2 !!!

The second problem is that `.init_array` section without number should
go last in the list. Not it has the lowest priority '0' and goes first.

The patch fixes both of the problems.

llvm-svn: 209875
2014-05-30 05:29:46 +00:00
Nick Kledzik f317d66c31 [mach-0] Add support for parsing compact unwind info section
llvm-svn: 209865
2014-05-29 23:50:48 +00:00
Nick Kledzik b367c25f28 [mach-o] Add support for parsing __eh_frame section. Generalize support for whether symbols in a section are ignored or illegal
llvm-svn: 209858
2014-05-29 23:07:20 +00:00
Nick Kledzik 9ede702bc4 [mach-o] Add support for parsing CFString sections
llvm-svn: 209844
2014-05-29 20:44:21 +00:00
Nick Kledzik cda69a279d [mach-o] Add support for parsing of weak-def symbols
llvm-svn: 209707
2014-05-28 02:04:45 +00:00
Nick Kledzik 8399d69cb2 [mach-o] rename test case
llvm-svn: 209705
2014-05-28 01:31:04 +00:00
Nick Kledzik 388f3d02de [mach-o] Support parsing of non-lazy-pointer sections
llvm-svn: 209704
2014-05-28 01:16:35 +00:00
Nick Kledzik a4a08d31cf [mach-o] Add support for initializers and terminators in object files
llvm-svn: 209700
2014-05-27 23:20:52 +00:00
Nick Kledzik 3e90e5f187 [mach-o] Add support for reading utf16 string literal sections
llvm-svn: 209684
2014-05-27 20:25:06 +00:00
Simon Atanasyan 1c04babce3 [Mips] Handle relocations against __gnu_local_gp symbol.
llvm-svn: 209644
2014-05-27 05:23:16 +00:00
Simon Atanasyan 2ffbb19335 [Mips] Handle R_MIPS_TLS_TPREL_HI16 / R_MIPS_TLS_TPREL_LO16 relocations.
llvm-svn: 209582
2014-05-24 16:45:31 +00:00
Rui Ueyama f713cced0e [PECOFF] Make a separate pass for /alternatename symbols.
/alternatename is a command line option to define a weak alias. You
can use it as /alternatename:foo=bar to define "foo" as a weak alias
for "bar".

Because it's a command line option, the weak alias mapping is in the
LinkingContext object, and not in a object file being read.

Previously, we looked up the mapping each time we read a new symbol
from a file, to check if there is a weak alias defined for the symbol.
That's not wrong, but had made function signature's a bit complicated --
we had to pass the mapping object to many functions. Now their
parameter lists are much cleaner.

This also has another (unrealized) benefit. parseFile() now read a
file and then add alias symbols to the file. In the first pass a
LinkingContext object is not used at all. That should make it easy
to read files from archive files speculatively, as the first pass
is free from side effect.

llvm-svn: 209486
2014-05-23 00:02:42 +00:00
Nick Kledzik 8a0bc44b71 [mach-o] Fix so that mach-o semantic errors return an error rather than assert
llvm-svn: 209469
2014-05-22 20:05:43 +00:00
Nick Kledzik e39685964b [mach-o] Use lit.local.cfg to enable mach-o test cases to be run
llvm-svn: 209383
2014-05-22 01:47:17 +00:00
Nick Kledzik a0c13a2420 [mach-o] parse literal sections into atoms
llvm-svn: 209379
2014-05-22 01:42:06 +00:00
Rafael Espindola 38eed1b86d Update for llvm's r209253.
llvm-svn: 209293
2014-05-21 13:07:41 +00:00
Rui Ueyama 85a0321b15 [PECOFF] Discard .debug sections.
llvm-svn: 209274
2014-05-21 05:56:31 +00:00
Simon Atanasyan c2ec8c5281 [Mips] Show warning if the linker cannot find a pair for a R_MIPS_HI16
relocation. In fact this case violates ABI but sometimes compilers might
produce such code.

llvm-svn: 209153
2014-05-19 18:48:57 +00:00