Commit Graph

137 Commits

Author SHA1 Message Date
Hemant Kulkarni 87dbac00a9 Add program header emission to ELF writer. This patch also rearranges sections for efficient memory utilization
llvm-svn: 167874
2012-11-13 21:34:45 +00:00
Shankar Easwaran 85bb045106 changes after mspencer reviews in phabricator
llvm-svn: 167871
2012-11-13 20:34:55 +00:00
Michael J. Spencer a5d22811af Fix style violations.
llvm-svn: 167869
2012-11-13 19:58:58 +00:00
Shankar Easwaran 70b4dcfbcd Adding support to resolve symbols with archive libraries in lld
llvm-svn: 167854
2012-11-13 18:39:10 +00:00
Hemant Kulkarni f828613945 Add absolute symbol scope recognition in lld/Core
llvm-svn: 167394
2012-11-05 19:13:54 +00:00
Nick Kledzik 8cf031e4cc rename dylibNamesToOrdinal now that it is an ivar
llvm-svn: 167254
2012-11-01 21:44:45 +00:00
Michael J. Spencer a1913fbda9 [ELF] Fix -Woverloaded-virtual
llvm-svn: 167246
2012-11-01 19:46:19 +00:00
Michael J. Spencer d91bc3c8bb [MachO] Fix use after free.
llvm-svn: 167245
2012-11-01 19:46:06 +00:00
Michael J. Spencer c1d704550a [MachO] Fix uninitialized variables.
llvm-svn: 167244
2012-11-01 19:45:53 +00:00
Michael J. Spencer e337e60552 Fix cl brokeness.
cl is not attempting to complete a templated class when used in this
context. The conversion forces this to happen.

Thanks to Richard Smith for figuring this out.

llvm-svn: 167166
2012-10-31 20:47:30 +00:00
Michael J. Spencer d2f7e50867 Add missing include.
llvm-svn: 167165
2012-10-31 20:47:11 +00:00
Sid Manning 823e8bb7be This patch changes the following:
* Use conventional naming for KindHandlers.
  * Add X86 relocation routines.
  * Use std::function instead of function pointers in _fixupHandler map.
  * Change _fixupHandler map from std::map to llvm::DenseMap.
  * Add simple testcase for x86 relocations.

llvm-svn: 166700
2012-10-25 17:53:04 +00:00
Sid Manning 2a59024ff8 This update does the following:
* Moves enum Scope from DefinedAtom.h to Atom.h
  * Adds scope method to AbsoluteAtom class
  * Updates YAML to print scope of AbsoluteAtoms
  * Update Native Reader/Writer to handle this new, "attribute"
  * Adds testcase 
Reviewed and approved by Nick Kledzik

llvm-svn: 166189
2012-10-18 17:16:19 +00:00
Sid Manning 42064e5b60 * Add relocation reference support for Hexagon and PowerPC.
- Hexagon has many relocation types, this patch covers just
      a subset, more will be added.
    - PowerPC support was added so that we can verify mixed endian
      environments.
  * Add some basic test cases
  * Update ldd-core to accept -endian flag

llvm-svn: 165477
2012-10-09 02:20:47 +00:00
Sid Manning e3612f0f21 Fix incorrect setting of EI_DATA
llvm-svn: 165310
2012-10-05 14:06:24 +00:00
Hemant Kulkarni 8bd276120f Added missing break in StockSectionChunk constructor.
Removed architecture dependent .sbss section creation.

Updated test case to show the change in section types and removal of a sbss section.

llvm-svn: 165181
2012-10-03 23:27:33 +00:00
Sid Manning 05c82a42dd * Return correct size and alignment for common symbols.
llvm-svn: 165170
2012-10-03 21:46:48 +00:00
Hemant Kulkarni cc613e1c25 Changed test output comparison to be consistent with the way llvm-objdump and llvm-readobj work.
llvm-svn: 165048
2012-10-02 21:12:21 +00:00
Hemant Kulkarni 08e410293f Emit symbol tables.
Reorganize to derive all sections from SectionChunk.
Construct section table header from SectionChunk.

llvm-svn: 164981
2012-10-01 23:53:20 +00:00
Sid Manning e861d43f65 This change:
* Updates ReaderELF.cpp contentType method to match ELF.h's logic and now handle
    typeData
  * Add -arch to ldd-core testdriver
  * Add testcase to check typeData
  * Update others to stay in sync with this change.

llvm-svn: 164976
2012-10-01 23:23:05 +00:00
Michael J. Spencer e2fb6c73f3 Fix -Wcovered-switch-default warning.
llvm-svn: 164846
2012-09-28 21:07:58 +00:00
Sid Manning d3a7e7e164 Add case for typeConstant in SectionChunk
llvm-svn: 164732
2012-09-26 22:46:17 +00:00
Sid Manning dd11020739 This patch makes use of recently added relocation reference data. The bulk
of this is derived from the Mach-O writer.  Reviewed by: Nick Kledzik.
 * Adds loop to SectionChunk::write traverse references calling the
   writer's fixup handler, applyFixup.
 * Adds method, ELFWriter::buildAtomToAddressMap to that creates a
   mapping from an atom to its runtime address.
 * Adds method, ELFWriter::addressOfAtom to return the runtime address
   of the atom. 

llvm-svn: 164618
2012-09-25 18:22:09 +00:00
Sid Manning 8caf4de31f Add ELFReference class - parse relocations needed by that class and update DefinedAtom to use the class. Tweak coding style. Add testcase to check relocations. Change was signed-off-by: Michael Spencer
llvm-svn: 164027
2012-09-17 12:49:38 +00:00
Sid Manning 37e3120af8 Fix environment path problem
llvm-svn: 163929
2012-09-14 20:04:36 +00:00
Hemant Kulkarni 927bbc2871 ELF support for LLD writer. The writer at present emits ELF header and section
table header. Skeleton code for ReferenceKinds.
Credits:
Doxygen by  Michael Spencer.
Origianl implementation from Macho by Sidney Manning.
Templatization, implementation of section header chunks, string table, ELF header by Hemant Kulkarni.

llvm-svn: 163906
2012-09-14 16:11:34 +00:00
Hemant Kulkarni f6e2bc07eb Test commit
llvm-svn: 163861
2012-09-14 00:00:39 +00:00
Michael J. Spencer 69ed53ab5f Fix warnings.
llvm-svn: 163573
2012-09-10 23:46:58 +00:00
Michael J. Spencer 298f38ee68 Hook up lld-test to llvm check-all. Patch by Andy Gibbs!
llvm-svn: 161067
2012-07-31 18:44:52 +00:00
Nick Kledzik 7243b89459 PR13467: Fix mach-o writer to handle case of zero stubs. Renumber TestingHelpers kind values
llvm-svn: 160982
2012-07-30 20:10:46 +00:00
Sid Manning 429a4bc172 Fix warning from -Wshadow. Report errors back to caller rather than calling
llvm::report_fatal_error.

llvm-svn: 160864
2012-07-27 14:52:18 +00:00
Sid Manning ad58efd69a Add a default constructor/destructor for ReaderOptionsPECOFF
llvm-svn: 160740
2012-07-25 17:16:46 +00:00
Sid Manning 51b1cc1428 Add test cases for ReaderELF.
llvm-svn: 160737
2012-07-25 17:14:55 +00:00
Sid Manning 556d84fe03 Add a new option, -reader which will select formats other than YAML for
reading.  YAML is still the default.

llvm-svn: 160736
2012-07-25 17:13:13 +00:00
Sid Manning 1a60141f99 Implement the ELF reader. The original implementation was by Hemant Kulkarni
with subsequent changes to use lower level interfaces done by me.

llvm-svn: 160732
2012-07-25 16:27:21 +00:00
Sid Manning d5c8fe3eea Trivial reformatting
llvm-svn: 160730
2012-07-25 15:16:02 +00:00
Marshall Clow 341f496538 Added description of Atom types from Nick's email
llvm-svn: 160468
2012-07-18 23:20:40 +00:00
Marshall Clow f33f0bbdcf Minor edits to match style guidelines. No functionality change
llvm-svn: 160370
2012-07-17 16:18:04 +00:00
Nick Kledzik 686eec102c Add missing LLVMSupport
llvm-svn: 159702
2012-07-04 02:16:35 +00:00
Michael J. Spencer e1db0daf25 Fix CMake build to use target_link_libraries. Patch by Sidney Manning!
llvm-svn: 159165
2012-06-25 21:42:38 +00:00
Michael J. Spencer 26f5a62712 Fix link order. Patch by Sidney Manning.
llvm-svn: 158945
2012-06-21 22:42:00 +00:00
Michael J. Spencer efcf099db5 Unused var warning.
llvm-svn: 158944
2012-06-21 22:41:46 +00:00
Nick Kledzik 920ceddf80 Fix Sphinx warning. Patch by Sean Silva
llvm-svn: 158678
2012-06-18 20:24:47 +00:00
Michael J. Spencer aedfa6a36b Fix MSVC compat. MSVC doesn't have bzero.
Although the code is not valid to begin with. It is trying to do a raw memory
copy of a non standard-layout type. nameoffset is not guaranteed to directly
follow cmdsize.

This should be properly fixed.

llvm-svn: 158612
2012-06-17 01:18:44 +00:00
Nick Kledzik 28854f56db Wordsmithing from patch from Sean Silva
llvm-svn: 158584
2012-06-16 00:52:17 +00:00
Nick Kledzik 7145cf6846 Add 'invalid' as a Reference Kind so that unknown/invalid kind strings can return that fact to the caller for use in constructing an error message, rather that triggering an assertion.
llvm-svn: 158547
2012-06-15 21:26:18 +00:00
Nick Kledzik 21f5d4d629 remove return statements after llvm_unreachable() as the compiler no longer warns abot missing return values
llvm-svn: 158544
2012-06-15 21:04:32 +00:00
Nick Kledzik 751eb3d2b3 use llvm_unreachable() instead of assert(0) for invalid enum values in switch statements
llvm-svn: 158542
2012-06-15 20:37:24 +00:00
Nick Kledzik d6a27324f9 Use ADT/StringSwitch
llvm-svn: 158541
2012-06-15 20:29:27 +00:00
Nick Kledzik c890ae41e2 flesh out mach-o Reference Kinds
llvm-svn: 158375
2012-06-12 23:01:30 +00:00