• Home
  • History
  • Annotate
  • only in /external/llvm/lib/Object/
History log of /external/llvm/lib/Object/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cd81d94322a39503e4a3e87b6ee03d4fcb3465fb 21-Jul-2014 Stephen Hines <srhines@google.com> Update LLVM for rebase to r212749.

Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
ndroid.mk
rchive.cpp
inary.cpp
MakeLists.txt
OFFObjectFile.cpp
LFObjectFile.cpp
LFYAML.cpp
rror.cpp
RObjectFile.cpp
LVMBuild.txt
achOObjectFile.cpp
achOUniversal.cpp
bject.cpp
bjectFile.cpp
ecordStreamer.cpp
ecordStreamer.h
tringTableBuilder.cpp
ymbolicFile.cpp
AML.cpp
075c621d834af7ffc32d2067fadb147cc1758b99 02-Jun-2014 Chris Wailes <chriswailes@google.com> Adds the ability to run the llvm test suite in-tree.

This was accomplished by building additional tools and hand-generating
several files that are auto-generated by the configuration system when
LLVM is built out-of-tree. The LTO, Interpreter, and DebugInfo libraries
are now being compiled, and several source files were added to existing
compilation targets.

To run these tests you must first run build/envsetup.sh and have used
lunch to select a target. You can then launch the test script by running:

cd $ANDROID_BUILD_TOP/external/llvm && ./android_test.sh

Bug: 15433215

Change-Id: I43d87de0a4620cdd46c8d0f825dd4428e8409702
ndroid.mk
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
ndroid.mk
rchive.cpp
MakeLists.txt
OFFObjectFile.cpp
OFFYAML.cpp
LF.cpp
LFYAML.cpp
LVMBuild.txt
achOObjectFile.cpp
achOUniversal.cpp
bject.cpp
tringTableBuilder.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
ndroid.mk
rchive.cpp
inary.cpp
MakeLists.txt
OFFObjectFile.cpp
OFFYAML.cpp
LF.cpp
LFObjectFile.cpp
LFYAML.cpp
rror.cpp
RObjectFile.cpp
LVMBuild.txt
achOObjectFile.cpp
achOUniversal.cpp
bject.cpp
bjectFile.cpp
ymbolicFile.cpp
AML.cpp
373aa5c665fe6df6b9c5586d397dc3617f25aab5 07-Feb-2014 Stephen Hines <srhines@google.com> Update LLVM for merge to 3.4.

Update config.h files.

Add RS SubtargetFeature for +long64 on ARM devices.

Adjust Android.mk for added/removed files:

+ Delinearization.cpp
- PathNumbering.cpp
- PathProfileInfo.cpp
- PathProfileVerifier.cpp
- ProfileDataLoader.cpp
- ProfileDataLoaderPass.cpp
- ProfileEstimatorPass.cpp
- ProfileInfo.cpp
- ProfileInfoLoader.cpp
- ProfileInfoLoaderPass.cpp
- ProfileVerifierPass.cpp

+ LiveRegUnits.cpp
- ShrinkWrapping.cpp
+ StackMaps.cpp
- StrongPHIElimination.cpp

+ DIEHash.cpp

+ LegacyPassManager.cpp

+ ELF.cpp

+ Unicode.cpp

- MipsOptimizeMathLibCalls.cpp

- MipsELFStreamer.cpp
+ MipsTargetStreamer.cpp

- EdgeProfiling.cpp
+ DataFlowSanitizer.cpp
+ DebugIR.cpp
- OptimalEdgeProfiling.cpp
- PathProfiling.cpp
- ProfilingUtils.cpp

- BasicBlockPlacement.cpp
+ LoopRerollPass.cpp
+ PartiallyInlineLibCalls.cpp
+ SampleProfile.cpp

+ GlobalStatus.cpp

Change-Id: I17dcf0bf53a1720acd8226ae3e30d84993562a91
ndroid.mk
ce9904c6ea8fd669978a8eefb854b330eb9828ff 12-Feb-2014 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/release_34' into merge-20140211

Conflicts:
lib/Linker/LinkModules.cpp
lib/Support/Unix/Signals.inc

Change-Id: Ia54f291fa5dc828052d2412736e8495c1282aa64
8a631b2cbe2f8621eb3679a4898205da577453b7 15-Nov-2013 Rui Ueyama <ruiu@google.com> Path: Recognize COFF import library file magic.

Summary: Make identify_magic to recognize COFF import file.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2165

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194852 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
bjectFile.cpp
3a226015a0ca52936763a079da582656164c2908 15-Nov-2013 Rui Ueyama <ruiu@google.com> Readobj: If NumbersOfSections is 0xffff, it's an COFF import library.

0xffff does not mean that there are 65535 sections in a COFF file but
indicates that it's a COFF import library. This patch fixes SEGV error
when an import library file is passed to llvm-readobj.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194844 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
5c042162beb3c2dd556e00aab84c4278a69cd5b1 04-Nov-2013 Zoran Jovanovic <zoran.jovanovic@imgtec.com> Support for microMIPS branch instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193992 91177308-0d34-0410-b5e6-96231b3b80d8
LF.cpp
bc884fd9f7bdb64d250be639edc8dc85a20a1975 02-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> move getSymbolNMTypeChar to the one program that needs it: nm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193933 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
66b8ec520f84c704e2a7f89dfa9ee1452ef5bc43 02-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert another use of getSymbolNMTypeChar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193932 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
1b6c8d1f6c834d8c3de4f78a4c99f8800f581b73 02-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Avoid some getSymbolNMTypeChar uses in COFFObjectFile.cpp itself.

This is a fixed version of 193928 which keeps these uses in sync.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193931 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
7e56fc6ae19e353ebdfaf327b46121b519a0c264 02-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "Don't use getSymbolNMTypeChar for implementing COFFObjectFile::getSymbolFileOffset."

Investigating a bot failure.

This reverts commit r193928.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193929 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
30c8dc8c8210ac7b043f4f038858a2bfa1d0b151 02-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use getSymbolNMTypeChar for implementing COFFObjectFile::getSymbolFileOffset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193928 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
6152f7d59615de9e4fa869bdc89570560c34bddb 02-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix llvm-nm to mach OS X's nm on some tests.

There is still a long way to go for llvm-nm, but at least we now match
nm's letter output in the cases we test for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193912 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
1aaf43c2a2ec0fd4c8dbfe56558237219c5f8af7 29-Oct-2013 Zoran Jovanovic <zoran.jovanovic@imgtec.com> Support for microMIPS jump instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193623 91177308-0d34-0410-b5e6-96231b3b80d8
LF.cpp
0082717cb537e2d1424f755a49510fa9f9e67071 23-Oct-2013 Zoran Jovanovic <zoran.jovanovic@imgtec.com> Support for microMIPS relocations 1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193247 91177308-0d34-0410-b5e6-96231b3b80d8
LF.cpp
b32b0376d4ac04fc2401e70aa0bdd2f6ce5a8968 16-Oct-2013 Rui Ueyama <ruiu@google.com> Path: Recognize Windows compiled resource file.

Some background: One can pass compiled resource files (.res files) directly
to the linker on Windows. If a resource file is given, the linker will run
"cvtres" command in background to convert the resource file to a COFF file
to link it.

What I'm trying to do with this patch is to make the linker to recognize
the resource file by file magic, so that it can run cvtres command.

Differential Revision: http://llvm-reviews.chandlerc.com/D1943

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192742 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
bjectFile.cpp
e3ba15c794839abe076e3e2bdf6c626396a19d4d 12-Oct-2013 Will Dietz <wdietz2@illinois.edu> Add missing #include's to cctype when using isdigit/alpha/etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192519 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
AML.cpp
29552222c2e7cbeb37fcd15d247597467f7b8544 27-Sep-2013 Rui Ueyama <ruiu@google.com> Object/COFF: Rename getXXX{Begin,End} -> xxx_{begin,end}.

It is mentioned in the LLVM coding standard that _begin() and _end() suffixes
should be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191569 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
a6610ee882fcb8bcad60d53fc52b80f00a3fddae 27-Sep-2013 Rui Ueyama <ruiu@google.com> Re-submit r191472 with a fix for big endian.

llvm-objdump: Dump COFF import table if -private-headers option is given.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191557 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
4715a11dcfe79de2a7a8b0b633d6ca272eea0bc3 27-Sep-2013 Rui Ueyama <ruiu@google.com> Revert "llvm-objdump: Dump COFF import table if -private-headers option is given."

This reverts commit r191472 because it's failing on BE machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191480 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
0c873adc82a81b0bce317c3e2cb3139e990a0f9e 27-Sep-2013 Rui Ueyama <ruiu@google.com> llvm-objdump: Dump COFF import table if -private-headers option is given.

This is a patch to add capability to llvm-objdump to dump COFF Import Table
entries, so that we can write tests for LLD checking Import Table contents.

llvm-objdump did not print anything but just file name if the format is COFF
and -private-headers option is given. This is a patch adds capability for
dumping DLL Import Table, which is specific to the COFF format.

In this patch I defined a new iterator to iterate over import table entries.
Also added a few functions to COFFObjectFile.cpp to access fields of the entry.

Differential Revision: http://llvm-reviews.chandlerc.com/D1719

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191472 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
766f25306af343fb2784350cb4d8cd9ca180f0d3 15-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> ELF: Add support for the exclude section bit for gas compat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190769 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
5510728d28bb1ee04abc32da3d21b7df12948053 01-Sep-2013 Charles Davis <cdavis5x@gmail.com> Move everything depending on Object/MachOFormat.h over to Support/MachO.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189728 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
achOUniversal.cpp
f69a29b23a116a3520f185054290c445abf9aa62 27-Aug-2013 Charles Davis <cdavis5x@gmail.com> Revert "Fix the build broken by r189315." and "Move everything depending on Object/MachOFormat.h over to Support/MachO.h."

This reverts commits r189319 and r189315. r189315 broke some tests on what I
believe are big-endian platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189321 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
achOUniversal.cpp
9c3dd1b0d1e96ef408b68da3b06c6ebd6c943601 27-Aug-2013 Charles Davis <cdavis5x@gmail.com> Move everything depending on Object/MachOFormat.h over to Support/MachO.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189315 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
achOUniversal.cpp
bf778d0546a4d8814339d946ca5c7e52291cc00c 27-Aug-2013 Charles Davis <cdavis5x@gmail.com> Support/MachO: Add a bunch of defines.

Right now we have two headers for the Mach-O format. I'd like to get rid
of one. Since the other object formats are all in Support, I chose to
keep the Mach-O header in Support, and discard the other one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189314 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0856d3d9712c9fc515f014102e9f03f389555e75 21-Aug-2013 Jakub Staszak <kubastaszak@gmail.com> Move #includes from .h to .cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188852 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
ead8d02a509cd69a74e01e4af90d8b237f30ed1c 08-Aug-2013 Stephen Hines <srhines@google.com> Update LLVM for merge to r187913.

Add HAVE_FUTIMENS to */include/llvm/Config/config.h

Update version number to 3.3 (even though this is tracking 3.4)

Removed lib/Archive

Added lib/Option

Android.mk changes:
- PathV2.cpp
- SimplifyLibCalls.cpp
- BlackList.cpp
- VecUtils.cpp
+ MD5.cpp
+ CFG.cpp
+ SpecialCaseList.cpp
+ MachOUniversal.cpp
+ StructurizeCFG.cpp

Change-Id: I8ee072cd0d4210a6a5492c0e6663f8464ff21386
ndroid.mk
d25fed9827c60c18707464b911518360a301b8c6 09-Aug-2013 Ulrich Weigand <ulrich.weigand@de.ibm.com> Add back missing PPC relocation types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188064 91177308-0d34-0410-b5e6-96231b3b80d8
LF.cpp
f5539a356c55126b5d519d0594b424bdcdeab647 09-Aug-2013 Michael J. Spencer <bigcheesegs@gmail.com> Add missing PPC64 relocation types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188031 91177308-0d34-0410-b5e6-96231b3b80d8
LF.cpp
081a1941b595f6294e4ce678fd61ef56a2ceb51e 09-Aug-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object] Split the ELF interface into 3 parts.

* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
LF.cpp
LFObjectFile.cpp
d4f9d05fde4b2cfd202a5852ec1ec3e960ef53ed 08-Aug-2013 David Fang <fang@csl.cornell.edu> initial draft of PPCMachObjectWriter.cpp
this records relocation entries in the mach-o object file
for PIC code generation.
tested on powerpc-darwin8, validated against darwin otool -rvV

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188004 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
fab2daa4a1127ecb217abe2b07c1769122b6fee1 08-Aug-2013 Stephen Hines <srhines@google.com> Merge commit '10251753b6897adcd22cc981c0cc42f348c109de' into merge-20130807

Conflicts:
lib/Archive/ArchiveReader.cpp
lib/Support/Unix/PathV2.inc

Change-Id: I29d8c1e321a4a380b6013f00bac6a8e4b593cc4e
9e8eafa0f0ad36c3e4397e97b67b8245b04ba618 07-Aug-2013 Dmitri Gribenko <gribozavr@gmail.com> YAMLTraits.h: replace DenseMap that used a bad implementation of DenseMapInfo
for StringRef with a StringMap

The bug is that the empty key compares equal to the tombstone key.

Also added an assertion to DenseMap to catch similar bugs in future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187866 91177308-0d34-0410-b5e6-96231b3b80d8
AML.cpp
782fdcefa50925f4a42159ae72552220c36fb24e 04-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> MachObjectFile: Don't leak on error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187698 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
cf48cf23de9207e4000df91aadc0beaa0989e33d 29-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add support for the 's' operation to llvm-ar.

If no other operation is specified, 's' becomes an operation instead of an
modifier. The s operation just creates a symbol table. It is the same as
running ranlib.

We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and
if the symbol table is present, then it is current. We use that to optimize
the most common case: a broken build system that thinks it has to run ranlib.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187353 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
6fccaafd8be0eb7619b5a210387b0d1254ef4174 25-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove the mblaze backend from llvm.

Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187145 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
797684279172bd56d08d4cefb76b1a9f9a4aabe6 24-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Delete the buffer in createObjectFile if it fails.

The Binary constructor takes ownership of the memory buffer. This is a fairly
unfortunate interface, but for now make createObjectFile consistent with it
by also deleting the buffer if it fails.

Fixes a leak in llvm-ar found by the valgrind bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187039 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
bd8f8a34ba13067e23bfff743a58df53a11a475d 23-Jul-2013 Eric Christopher <echristo@gmail.com> Typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186886 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
60d659172cb7a85ea67c5d94c9f465c98c4e4786 23-Jul-2013 Eric Christopher <echristo@gmail.com> 80-column tidying. Formatting choices by clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186885 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
2f6c0484d68270f09eecac03b7e56053153203f3 20-Jul-2013 Rui Ueyama <ruiu@google.com> Retry submitting r186623: COFFDumper: Dump data directory entries.

The original change was rolled back in r186627 because of test
failures on the big endian machine. I believe I fixed the issue
so re-submitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186734 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
9d1359453fc5db2ff9fb334fe205a14c30ed244d 19-Jul-2013 Rui Ueyama <ruiu@google.com> Revert "COFFDumper: Dump data directory entries."

Because it broke s390x and ppc64-linux buildbots. This reverts commit r186623.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186627 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
06bd2061fc40bfa3560bc200c396595cc4ed3a2e 19-Jul-2013 Rui Ueyama <ruiu@google.com> COFFDumper: Dump data directory entries.

Summary:
Dump optional data directory entries in the PE/COFF header, so that
we can test the output of LLD linker. This patch updates the test binary
file, but the source of the binary is the same. I just re-linked the file.
I don't know how the previous file was linked, but the previous file did
not have any data directory entries for some reason.

Reviewers: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1148

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186623 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
4172a8abbabea2359d91bb07101166565127d798 16-Jul-2013 Craig Topper <craig.topper@gmail.com> Add 'const' qualifiers to static const char* variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186371 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
34ac52d9377b104c83f80184f284199d68732f07 12-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Change llvm-ar to use lib/Object.

This fixes two bugs is lib/Object that the use in llvm-ar found:
* In OS X created archives, the name can be padded with nulls. Strip them.
* In the constructor, remember the first non special member and use that in
begin_children. This makes sure we skip all special members, not just the
first one.

The change to llvm-ar itself consist of
* Using lib/Object for reading archives instead of ArchiveReader.cpp.
* Writing the modified archive directly, instead of creating an in memory
representation.

The old Archive library was way more general than what is needed, as can
be seen by the diffstat of this patch.

Having llvm-ar using lib/Object now opens the way for creating regular symbol
tables for both native objects and bitcode files so that we can use those
archives for LTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186197 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
5e102c6c48f2cdfe1741f60805c830fb1e17fa47 12-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't reject an empty archive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186159 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
a739759fca088d277cbb78e3fd4b359d68a1cbcb 11-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Find the symbol table on archives created on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186041 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
5159718095bd8a18c1661889e93af3aca8eaa5aa 10-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't crash in 'llvm -s' when an archive has no symtab.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186029 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
9941bdd1fec00aa7a72117d2c2e21724c275e89a 09-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add missing getters. They will be used in llvm-ar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185937 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
2012593f180d29081e6c609f667e1f63b729209a 09-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Archive members cannot be larger than 4GB. Return a uint32_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185936 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
c5f8757c727975e9a9d6247cc68fb79d7f4cff8f 09-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add getHeader helper and move ToHeader to the cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185933 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
be6b9101d412711b69f6cfc1068efdf0ba7eb586 09-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Compute the size of an archive member in the constructor.

It is always computed the same way (by parsing the header). Doing it in the
constructor simplifies the callers a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185905 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
5263d0aa6a0227ccd9ed8062c84b294137e88a68 09-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Move some code out of line. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185901 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
845e196a52d52abcd789612750f6f34af3a2cc79 09-Jul-2013 Sean Silva <silvas@purdue.edu> Make BinaryRef output correctly in case of empty data.

Previously, it would simply output nothing, but it should output an
empty string `""`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185894 91177308-0d34-0410-b5e6-96231b3b80d8
AML.cpp
23191804e8cab4e60c82cd39f3a7d2ea152489a5 05-Jul-2013 Sylvestre Ledru <sylvestre@debian.org> Remove a useless declarations (found by scan-build)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185709 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
4a0bf5423c2dc7eb8ae197447b4b61e6517f108a 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the raw member names in Archive::Archive.

This a bit more efficient and avoids having a function that uses the string
table being called by a function that searches for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185680 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
6d88f9b73ae8e9170cd8da729895a03a785cc633 04-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add support for archives with no symbol table or string table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185664 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
09a7f6016ae87e97275e18ea662ff32a120c04a4 03-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add support for gnu archives with a string table and no symtab.

While there, use early returns to reduce nesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185547 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
f49d8fcbd594007ac6f25a1f1f90919221011f97 28-Jun-2013 Alexey Samsonov <samsonov@google.com> Make a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185139 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
068463b714bd53fffd41322a5654b4f359c2166c 22-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Make symbol table top-level key.

Although in reality the symbol table in ELF resides in a section, the
standard requires that there be no more than one SHT_SYMTAB. To enforce
this constraint, it is cleaner to group all the symbols under a
top-level `Symbols` key on the object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184627 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
4235ba32f2610ee2ed1e0c4bfca5c67835e9f97d 21-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Don't explicitly set `Binding` with STB_*

Instead, just have 3 sub-lists, one for each of
{STB_LOCAL,STB_GLOBAL,STB_WEAK}.

This allows us to be a lot more explicit w.r.t. the symbol ordering in
the object file, because if we allowed explicitly setting the STB_*
`Binding` key for the symbol, then we might have ended up having to
shuffle STB_LOCAL symbols to the front of the list, which is likely to
cause confusion and potential for error.

Also, this new approach is simpler ;)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184506 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
e38f640b22979994b42fb2f2aafc44cc39c20e8e 20-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Add support for st_value and st_size.

After this patch, the ELF file produced by
`yaml2obj-elf-symbol-basic.yaml`, when linked and executed on x86_64
(under SysV ABI, obviously; I tested on Linux), produces a working
executable that goes into an infinite loop!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184469 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
6525e92b32c52772f7d750ada7084245655629e6 20-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Allow symbols to reference sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184468 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
f9326c248ad49a0bba3253d0473051b7094455c7 19-Jun-2013 NAKAMURA Takumi <geek4civic@gmail.com> MachOUniversal.cpp: Fix abuse of Twine. It would be sufficient to use std::string instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184291 91177308-0d34-0410-b5e6-96231b3b80d8
achOUniversal.cpp
ea94e114b436996805012f4395b0a9182aed2334 19-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Support ELFOSABI_* enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184268 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
5ba1225fb074f8035668637292d994d4c39757d1 19-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Support st_info through `Binding` and `Type` YAML keys.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184263 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
afcf60fe15999ea07193118f447a34f41171e433 19-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj][ELF] Rudimentary symbol table support.

Currently, we only output the name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184255 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
9c22f87b1374b06dc6c07f6e8047890e390bbe2d 18-Jun-2013 Alexey Samsonov <samsonov@google.com> Basic support for parsing Mach-O universal binaries in LLVMObject library

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184191 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
MakeLists.txt
rror.cpp
achOObjectFile.cpp
achOUniversal.cpp
bjectFile.cpp
79ac9c8402d4113d42ff2d713c7acdfa800d2397 18-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't convert object_error's enum to and from int.

This allows the compiler to see the enum and warn about it. While in here,
fix a switch to not use a default and fix style violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184186 91177308-0d34-0410-b5e6-96231b3b80d8
rror.cpp
fe57e347a57d643bbbcc9c19c8267a3e8c06b5a6 15-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj] Add support for sh_link via `Link` key.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184022 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
250bfb1745fd72615b618e3c8748321a104d80d0 15-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove the LLVM specific archive index.

Archive files (.a) can have a symbol table indicating which object
files in them define which symbols. The purpose of this symbol table
is to speed up linking by allowing the linker the read only the .o
files it is actually going to use instead of having to parse every
object's symbol table.

LLVM's archive library currently supports a LLVM specific format for
such table. It is hard to see any value in that now that llvm-ld is
gone:

* System linkers don't use it: GNU ar uses the same plugin as the
linker to create archive files with a regular index. The OS X ar
creates no symbol table for IL files, I assume the linker just parses
all IL files.

* It doesn't interact well with archives having both IL and native objects.

* We probably don't want to be responsible for yet another archive
format variant.

This patch then:

* Removes support for creating and reading such index from lib/Archive.
* Remove llvm-ranlib, since there is nothing left for it to do.

We should in the future add support for regular indexes to llvm-ar for
both native and IL objects. When we do that, llvm-ranlib should be
reimplemented as a symlink to llvm-ar, as it is equivalent to "ar s".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184019 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
97d37e818153c6c5f844ddebaab26be324dbe41c 14-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj] Add support for sh_addralign via `AddressAlign` key.

For consistency, change the address in the test case from 0xDEADBEEF to
0xCAFEBABE since 0xCAFEBABE that actually has a 2-byte alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183962 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
2a7e79a30f87be4103963e6049a2f1cf171f502c 14-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj] Add support for specifying raw section content.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183955 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
45b812d1a79f3f8642821e65a25d92e3d741a095 14-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj] Add sh_addr via `Address` key.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183954 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
274264ce2ba93d26702f7ebfe6aea121df44113f 14-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj] Initial ELF section support.

The current functionality is extremely basic and a bit rough around the
edges, but it will flesh out in future commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183953 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
1878f9a7874b1ff569d745c0269f49d3daf7203d 12-Jun-2013 Stephen Hines <srhines@google.com> Merge commit '100fbdd06be7590b23c4707a98cd605bdb519498' into merge_20130612
4bf771b4e6d37ae1d6ae08ea27c4070a3a09784d 12-Jun-2013 Rui Ueyama <ruiu@google.com> readobj: Dump PE/COFF optional records.

These records are mandatory for executables and are used by the loader.

Reviewers: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D939

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183852 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
OFFObjectFile.cpp
2fd163fcd19358703d0898c1e7924c536f57baa7 12-Jun-2013 Sean Silva <silvas@purdue.edu> 80-cols

This slipped in during a hasty renaming.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183810 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
4fbf6633024d40dcb7849f45db5a4d41b2a5b3f1 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix variable name style. Don't cast to and from int.

This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183749 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
d27a9785d5290a54b1400c85d70e92c2b6106098 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183747 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
de6fe4d604e561a58854f09a3d985ea59e4db973 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert a use of sys::identifyFileType to sys::fs::identify_magic.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183745 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
457c8ebfd070eb7ee840ec97142f975974cfc834 11-Jun-2013 Sean Silva <silvas@purdue.edu> Fix dubious type name similar to member name.

Should bring bots back to life.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183715 91177308-0d34-0410-b5e6-96231b3b80d8
LFYAML.cpp
5918b7a03d4d6a52e18f7c102250c9cfd6ae52dd 11-Jun-2013 Sean Silva <silvas@purdue.edu> [yaml2obj] Initial ELF support.

Currently, only emitting the ELF header is supported (no sections or
segments).

The ELFYAML code organization is broadly similar to the COFFYAML code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183711 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
LFYAML.cpp
f12745f7a7e68c05c89ebd515b9b4faedce37dd0 10-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Pass a StringRef to sys::identifyFileType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183669 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
bjectFile.cpp
dbfb960e74cc37e7a066f7fbcf78e6936a9e7794 08-Jun-2013 Sean Silva <silvas@purdue.edu> Don't artifically restrict input object size.

sys::IdentifyFileType is already conscious of the length, and
object_error::invalid_file_type is returned below anyway if
sys::IdentifyFileType doesn't recognize the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183605 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
149d1a1894a92872ad5d28c452e813d34c3d2658 07-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use isxdigit.

Thanks to Benjamin Kramer for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183540 91177308-0d34-0410-b5e6-96231b3b80d8
AML.cpp
54154f3bf1ae3d2dfd68cc9474cad061b3338a40 06-Jun-2013 Kevin Enderby <enderby@apple.com> Teach llvm-objdump with the -macho parser how to use the data in code table
from the LC_DATA_IN_CODE load command. And when disassembling print
the data in code formatted for the kind of data it and not disassemble those
bytes.

I added the format specific functionality to the derived class MachOObjectFile
since these tables only appears in Mach-O object files. This is my first
attempt to modify the libObject stuff so if folks have better suggestions
how to fit this in or suggestions on the implementation please let me know.

rdar://11791371


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183424 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
e3a0e7f29dde261ca00835e763e26de41a8684f6 06-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Print symbol names in relocations when dumping COFF as YAML.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183403 91177308-0d34-0410-b5e6-96231b3b80d8
OFFYAML.cpp
4370ddb8b821bda66478160c1a1c5714a1877d85 06-Jun-2013 Sean Silva <silvas@purdue.edu> Add writeAsHex(raw_ostream &) method to BinaryRef.

This hides the implementation. A future commit will remove the
error-prone getHex() and getBinary() methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183352 91177308-0d34-0410-b5e6-96231b3b80d8
AML.cpp
6acc982e74cd8a10d097c10254d7215028e7f036 06-Jun-2013 Sean Silva <silvas@purdue.edu> Rename BinaryRef::isBinary to more descriptive DataIsHexString.

And add a doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183350 91177308-0d34-0410-b5e6-96231b3b80d8
AML.cpp
639adc59f86d0526dbace4a1ecc4924c6c52e1cd 06-Jun-2013 Sean Silva <silvas@purdue.edu> Add writeAsBinary(raw_ostream &) method to BinaryRef.

Previously, yaml2coff.cpp had a writeHexData static helper function to
do this, but it is generally useful functionality.

Also, validate hex strings up-front to avoid running having to handle
errors "deep inside" the yaml2obj code (it also gives better diagnostics
than it used to).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183345 91177308-0d34-0410-b5e6-96231b3b80d8
AML.cpp
23a22cdedda691b5ed39f75bc1a846fd890f07fb 05-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't print default values for NumberOfAuxSymbols and AuxiliaryData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183293 91177308-0d34-0410-b5e6-96231b3b80d8
OFFYAML.cpp
5fd5fe0f7bfac0f7973475fcf7a5f8061d983538 05-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Move BinaryRef to a new include/llvm/Object/YAML.h file.

It will be used for ELF dumping too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183287 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
OFFYAML.cpp
AML.cpp
6c1202c459ffa6d693ad92fa84e43902bc780bca 05-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Handle relocations that don't point to symbols.

In ELF (as in MachO), not all relocations point to symbols. Represent this
properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj
ELF's dumper to handle relocatios without symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183284 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
891c0cd3c1c1f408d2478ef9c35fe152d2ba5c04 03-Jun-2013 Rui Ueyama <ruiu@google.com> [Object/COFF] Fix Windows .lib name handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183091 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
06120815a252676ea8abfddf4f80f549ef9a9f06 31-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename COFFYaml.h to COFFYAML.h for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183042 91177308-0d34-0410-b5e6-96231b3b80d8
OFFYAML.cpp
05bc4a6f20fb4bad971dc6ebb86b9ee29307bd3d 31-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't allocate temporary string for section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183040 91177308-0d34-0410-b5e6-96231b3b80d8
OFFYAML.cpp
7486d92a6c949a193bb75c0ffa0170eeb2fabb80 30-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Change how we iterate over relocations on ELF.

For COFF and MachO, sections semantically have relocations that apply to them.
That is not the case on ELF.

In relocatable objects (.o), a section with relocations in ELF has offsets to
another section where the relocations should be applied.

In dynamic objects and executables, relocations don't have an offset, they have
a virtual address. The section sh_info may or may not point to another section,
but that is not actually used for resolving the relocations.

This patch exposes that in the ObjectFile API. It has the following advantages:

* Most (all?) clients can handle this more efficiently. They will normally walk
all relocations, so doing an effort to iterate in a particular order doesn't
save time.

* llvm-readobj now prints relocations in the same way the native readelf does.

* probably most important, relocations that don't point to any section are now
visible. This is the case of relocations in the rela.dyn section. See the
updated relocation-executable.test for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182908 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
c6af2432c802d241c8fffbe0371c023e6c58844e 25-May-2013 Michael J. Spencer <bigcheesegs@gmail.com> Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
2bbe3781471936fa0c37ad738fa86b72997c6831 18-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert obj2yaml to use yamlio.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182169 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
OFFYAML.cpp
ebb9f17240dd72f3983d2de884d77f03d6eea4c8 15-May-2013 Ahmed Bougacha <ahmed.bougacha@gmail.com> Object: Fix Mach-O relocation printing.

There were two problems that made llvm-objdump -r crash:
- for non-scattered relocations, the symbol/section index is actually in the
(aptly named) symbolnum field.
- sections are 1-indexed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181843 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
167957fa095bc7200b908e6e142be3e604bcfeea 09-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Change getRelocationAdditionalInfo to be ELF only.

It was only implemented for ELF where it collected the Addend, so this
patch also renames it to getRelocationAddend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181502 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
9dbeb69a345d12b15571769cfacf1d5e1a7ce378 03-May-2013 Stephen Hines <srhines@google.com> Update LLVM for merge to r180947.

Change-Id: Ic9e7daa7ef3789298c49a7b308af92115f5d682d
ndroid.mk
38578c4919ea18ceb27e29988b2d857afe6215bf 03-May-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-20130502

Conflicts:
lib/Support/Unix/Signals.inc
unittests/Transforms/Utils/Cloning.cpp

Change-Id: I027581a4390ec3ce4cd8d33da8b5f4c0c7d372c8
40be1e85665d10f5444186f0e7106e368dd735b8 01-May-2013 Filip Pizlo <fpizlo@apple.com> This patch breaks up Wrap.h so that it does not have to include all of
the things, and renames it to CBindingWrapping.h. I also moved
CBindingWrapping.h into Support/.

This new file just contains the macros for defining different wrap/unwrap
methods.

The calls to those macros, as well as any custom wrap/unwrap definitions
(like for array of Values for example), are put into corresponding C++
headers.

Doing this required some #include surgery, since some .cpp files relied
on the fact that including Wrap.h implicitly caused the inclusion of a
bunch of other things.

This also now means that the C++ headers will include their corresponding
C API headers; for example Value.h must include llvm-c/Core.h. I think
this is harmless, since the C API headers contain just external function
declarations and some C types, so I don't believe there should be any
nasty dependency issues here.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180881 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
e87dadc44b1544c35e13cf48dfe167109929a944 30-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix Addend computation for non external relocations on Macho.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180790 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
59a0e79631ed851d98cf9c2ba6fa5f9aafdfdc93 30-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add getSymbolAlignment to the ObjectFile interface.

For regular object files this is only meaningful for common symbols. An object
file format with direct support for atoms should be able to provide alignment
information for all symbols.

This replaces getCommonSymbolAlignment and fixes
test-common-symbols-alignment.ll on darwin. This also includes a fix to
MachOObjectFile::getSymbolFlags. It was marking undefined symbols as common
(already tested by existing mcjit tests now that it is used).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180736 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
bjectFile.cpp
2173e1839c2d00f7f980450dd537047b7b376e6b 26-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm/Object/MachO.h in macho-dumper. Drop the old macho parser.

For Mach-O there were 2 implementations for parsing object files. A
standalone llvm/Object/MachOObject.h and llvm/Object/MachO.h which
implements the generic interface in llvm/Object/ObjectFile.h.

This patch adds the missing features to MachO.h, moves macho-dump to
use MachO.h and removes ObjectFile.h.

In addition to making sure that check-all is clean, I checked that the
new version produces exactly the same output in all Mach-O files in a
llvm+clang build directory (including executables and shared
libraries).

To test the performance, I ran macho-dump over all the files in a
llvm+clang build directory again, but this time redirecting the output
to /dev/null. Both the old and new versions take about 4.6 seconds
(2.5 user) to finish.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180624 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
achOObject.cpp
achOObjectFile.cpp
e5330f77cf420d71cfd46c960387eb06edeccbf8 25-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Use a pointer as the relocation iterator.

Since the relocation iterator walks only the relocations in one section, we
can just use a pointer and avoid fetching information about the section at
every reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180262 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
956ca7265c697107708468b7e1b2fd21f4185bae 25-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Clarify getRelocationAddress x getRelocationOffset a bit.

getRelocationAddress is for dynamic libraries and executables,
getRelocationOffset for relocatable objects.

Mark the getRelocationAddress of COFF and MachO as not implemented yet. Add a
test of ELF's. llvm-readobj -r now prints the same values as readelf -r.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180259 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
802fe9340d032d20195b00334356cf63b303386c 24-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Use pointers to iterate over symbols.

While here, don't report a dummy symbol for relocations that don't have symbols.
We used to says such relocations were for the first defined symbol, but now we
return end_symbols(). The llvm-readobj output change agrees with otool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180214 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
51cc82887cdd6795caaffc0ece500481b697bced 24-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert r180189.

This should bring the ppc bots back. I will try to write a test that would
have found the problem on a little endian system too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180194 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f69a81f001613b834960bae69cd6099265cc4d98 24-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Formatting fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180190 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
709d2fdb11a623ab2dd3b0a3754d09ad0f91b7e2 24-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Use a pointer as the relocation iterator.

Since the relocation iterator walks only the relocations in one section, we
can just use a pointer and avoid fetching information about the section at
every reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180189 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
3e39731e88f2d4f597cebc74388fd6650ca4f604 23-Apr-2013 Eric Christopher <echristo@gmail.com> Move C++ code out of the C headers and into either C++ headers
or the C++ files themselves. This enables people to use
just a C compiler to interoperate with LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180063 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
143d223447cb55ae08d313078f7a5917873247ae 19-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> refactor the struct byte swapping to a helper function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179851 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
db5f9270207292b62ea847560c5dd4e9873b57f5 19-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't read one command past the end.

Thanks to Evgeniy Stepanov for reporting this.

It might be a good idea to add a command iterator abstraction to MachO.h, but
this fixes the bug for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179848 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
fd7aa38e304a09fa0ef51b85b773b649b7e58c5e 18-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> At Jim Grosbach's request detemplate Object/MachO.h.

We are still able to handle mixed endian objects by swapping one struct at a
time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179778 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
21a01d1ea89dba97c4f9e1f9f41485729a4046bc 15-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Make the host endianness check an integer constant expression.

I will remove the isBigEndianHost function once I update clang.

The ifdef logic is designed to
* not use configure/cmake to avoid breaking -arch i686 -arch ppc.
* default to little endian
* be as small as possible

It looks like sys/endian.h is the preferred header on most modern BSD systems,
but it is better to change this in a followup patch as machine/endian.h is
available on FreeBSD, OpenBSD, NetBSD and OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179527 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
da2a2372c6ae715befae7f086afe769dd80814f3 13-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Finish templating MachObjectFile over endianness.

We are now able to handle big endian macho files in llvm-readobject. Thanks to
David Fang for providing the object files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179440 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
e292347503cd7598429c08f9984ab3e0a44ab8a3 12-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 179294 back, but don't use bit fields so that it works on big endian hosts.

Original message:

Print more information about relocations.

With this patch llvm-readobj now prints if a relocation is pcrel, its length,
if it is extern and if it is scattered.

It also refactors the code a bit to use bit fields instead of shifts and
masks all over the place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179345 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
59a8b5a8f09ae4c4f3b0e3d8025c6b4cf3ca1f1a 11-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert my last two commits while I debug what is wrong in a big endian host.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179303 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
4edf092787cab37d46da96eb1e9df0677ca30b1d 11-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Print more information about relocations.

With this patch llvm-readobj now prints if a relocation is pcrel, its length,
if it is extern and if it is scattered.

It also refactors the code a bit to use bit fields instead of shifts and
masks all over the place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179294 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
8bf80061ba44af16b4597627ca7d6d7fc1bed64e 11-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix MachO's getRelocationAdditionalInfo.

It was returning the loaded address of the section containing the relocation,
which really doesn't seem to be the intent of this function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179255 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
b08c6df6787971502bd51e30b0f1038c1ea0dc2c 10-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Template MachOObjectFile over endianness too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179179 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
a2561a0153237291980722383f409a6499b12efc 10-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Template the MachO types over endianness.

For now they are still only used as little endian.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179147 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f6cfc15705140cc958b784a1bc98f7f0f09be6be 09-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert MachOObjectFile to a template.

For now it is templated only on being 64 or 32 bits. I will add little/big
endian next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179097 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
8faf7df1447ca6ea4a3ff8f82789923d1839fb54 09-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> More uses for SymbolTableEntryBase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179076 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
7df9c57651574feccd53aec0aac469dea2b48bc6 09-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a SymbolTableEntryBase.

Use it when we don't need to know if we have a 32 or 64 bit SymbolTableEntry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179074 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
3388589fc102b873ee9b73ffdab0f532ee3ceda6 09-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a SectionBase struct.

Use it to share code and when we don't need to know if we have a 32 or 64
bit Section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179072 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
335f1d46d82a4d6b5a7317ccc73178a47b62fc25 08-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Template the MachO types over the word size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179051 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
a9408bafcc4ea0a42f9dd7a251845372d64abb8b 08-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove is64BitLoadCommand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179048 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
9d55c099d628d7835dd1b502cb29c96cae350099 08-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add all 4 MachO object types. Use the stored type to implement is64Bits().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179021 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
8764c8979c66966b5af62a0a316acead47c038cd 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Make MachOObjectFile independent from MachOObject.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178998 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f1cc8001fd405c3ec903cb6caf97a943bb3898ae 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Implement MachOObjectFile::getData directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178997 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
49698a1e691185a2a94d13edcce5c4a8d0db4762 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Implement MachOObjectFile::is64Bit directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178996 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
c90cc18b6a28bfd49e74ce609e161ef178f5a2d3 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Implement MachOObjectFile::getHeaderSize directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178995 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
433611bdf395d08093e3edd52846c1774b46caf2 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Implement MachOObjectFile::getHeader directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178994 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0f08eb135997a94ba37f79aaeb306993c21bbae2 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Implement MachOObjectFile::getHeaderSize and MachOObjectFile::getData.

These were the last missing forwarding functions. Also consistently use
the forwarding functions instead of using MachOObj directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178992 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
6ab85a81d711b1e9d3bbc02e05812e7f867a7c40 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove LoadCommandInfo now that we always have a pointer to the command.

LoadCommandInfo was needed to keep a command and its offset in the file. Now
that we always have a pointer to the command, we don't need the offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178991 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
77638d9110d67333e4ea8e6bd3206606a89bc24f 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add MachOObjectFile::LoadCommandInfo.

This avoids using MachOObject::getLoadCommandInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178990 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f305127f0b46d0782f53c8aeab448f9dfeb769ec 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Use getLoadCommandInfo instead of MachOObj->getLoadCommandInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178989 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
6f1f33915a09a862fd83e7c9f1dc465c2b9e427c 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Construct MachOObject in MachOObjectFile's constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178988 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
2c6f997290f589b80da903e33718175666557dd7 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178987 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
bjectFile.cpp
3eff318cbac281d46e8c8dfef16ffccbceebc855 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove MachOObjectFile::getObject.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178986 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0be4eafd9c90d5e584b951fe2970f024341486c3 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove two uses of getObject.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178985 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
196abbffe9b7a760593d68b99cbb5f961efc8e2a 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove last use of InMemoryStruct in llvm-objdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178979 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
68d287d19e6918f46e58456fdd237c049efe372e 06-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove last use of InMemoryStruct from MachOObjectFile.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178948 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
82a21077a004087a87711bfd7a4ab171cebaa5ec 06-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use InMemoryStruct<macho::SymtabLoadCommand>.

This also required not using the RegisterStringTable API, which is also a
good thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178947 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
05b5bdd024d07e7a62f1cdc39f465e10ce5dbc6d 06-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use InMemoryStruct in getSymbol64TableEntry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178946 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
00555c13be54b7933cf5a68b50f8a7494bcd5777 06-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use InMemoryStruct in getSymbolTableEntry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178945 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
5cf0f51ae6530751eeeccefa55c87f1d3422d0ae 06-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use InMemoryStruct in getRelocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178943 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0e5dc8aacb548d51b0ca9035a7d449a8e5862dd2 05-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Define versions of Section that are explicitly marked as little endian.

These should really be templated like ELF, but this is a start.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178896 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
c1cd6aa7a485933fa1b451c8df899ae78382b391 05-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use InMemoryStruct in getSection and getSection64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178894 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f16c2bb320f4d5b33dfaf8df8865f547e6d66005 05-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't fetch pointers from a InMemoryStruct.

InMemoryStruct is extremely dangerous as it returns data from an internal
buffer when the endiannes doesn't match. This should fix the tests on big
endian hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178875 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
2d4629c5d7dcc6582fa7b85a517744f1a3654eba 19-Mar-2013 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2013_03_18
5adb136be579e8fff3734461580cb34d1d2983b8 06-Mar-2013 Stephen Hines <srhines@google.com> Merge commit 'b3201c5cf1e183d840f7c99ff779d57f1549d8e5' into merge_20130226

Conflicts:
include/llvm/Support/ELF.h
lib/Support/DeltaAlgorithm.cpp

Change-Id: I24a4fbce62eb39d924efee3c687b55e1e17b30cd
b3e6b04aea9d12183b97770f7b250622e78fe7f1 28-Feb-2013 Eric Christopher <echristo@gmail.com> Move an assert earlier in a file and check that the result of
our bitwise compare is equal to the field we're looking for.

Noticed on inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176296 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
87d0b9ed1462705dd9bf1cb7f67d0bf03af776c8 12-Feb-2013 Guy Benyei <guy.benyei@intel.com> Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
0f76e648d800d7641b4e6e6decb90949cd680b03 03-Feb-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object][Archive] Improve performance.

Improve performance of iterating over children and accessing the member file
buffer by caching the file size and moving code out to the header.

This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both
fixing a memory leak and removing a malloc.

This takes getBuffer from ~10% of the time in lld to unmeasurable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174272 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
d9d2f187759d0154574657c195068d367c338473 03-Feb-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174271 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
133f6b8582f12ab4fdaee3b870d4bcb12d61ca9b 31-Jan-2013 Jim Grosbach <grosbach@apple.com> Object: Fix errant fallthrough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174079 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
a965baca3c7ce1ced00446cff1c6395d03dfed52 25-Jan-2013 Eli Bendersky <eliben@google.com> When encountering an unknown file format, ObjectFile::createObjectFile should
politely report it instead of running into llvm_unreachable.

Also patch llvm-dwarfdump to actually check whether the file it's attempting to
dump is a valid object file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173489 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
059800f9e3fee2852672f846d91a2da14da7783a 21-Jan-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-llvm

Conflicts:
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/MC/MCAssembler.cpp
lib/Support/Atomic.cpp
lib/Support/Memory.cpp
lib/Target/ARM/ARMJITInfo.cpp

Change-Id: Ib339baf88df5b04870c8df1bedcfe1f877ccab8d
a94c33942373cb504b6e64c95415165907a89d34 18-Jan-2013 Daniel Dunbar <daniel@zuster.org> [MC/Mach-O] Add support for linker options in Mach-O files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172779 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
ac97f5ce486d1ca2967607028eacddd860aaddd0 15-Jan-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object][ELF] Simplify ELFObjectFile by using ELFType.

This simplifies the usage and implementation of ELFObjectFile by using ELFType
to replace:

<endianness target_endianness, std::size_t max_alignment, bool is64Bits>

This does complicate the base ELF types as they must now use template template
parameters to partially specialize for the 32 and 64bit cases. However these
are only defined once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172515 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
5a80eefdf7ef9022cd148b9eed16aa3c14b59a56 14-Jan-2013 David Greene <greened@obbligato.org> Fix More Casts

Fix another cast-away-const cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172466 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
7932c41884f182ae44a3feacc8a6a462e9097ca1 10-Jan-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object][Archive] Fix name handling with bsd style long names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172026 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
bf82b07f5f2ff1ebd3fb607a9f0d31d2b5ada947 10-Jan-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object][Archive] Apparently StringRef::getAsInteger for APInt accepts spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172022 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
e92800dd533988c46e58b0f4226df76a3bb1cb0c 09-Jan-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object][Archive] Use uint64_t instead of APInt. It is significantly faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172015 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
4d9c5397b4a3be747bdb73f1d24c3fdbaaf438fe 04-Jan-2013 Michael J. Spencer <bigcheesegs@gmail.com> [Object][ELF] Add a maximum alignment. This is used by createELFObjectFile to create a properly aligned reader.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171520 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
cef81b37c77978cd4dddb4a5ad13564793ded155 21-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Add a function to get the segment name of a section.

On MachO, sections also have segment names. When a tool looking at a .o file
prints a segment name, this is what they mean. In reality, a .o has only one
anonymous, segment.

This patch adds a MachO only function to fetch that segment name. I named it
getSectionFinalSegmentName since the main use for the name seems to be inform
the linker with segment this section should go to.

The patch also changes MachOObjectFile::getSectionName to return just the
section name instead of computing SegmentName,SectionName.

The main difference from the previous patch is that it doesn't use
InMemoryStruct. It is extremely dangerous: if the endians match it returns
a pointer to the file buffer, if not, it returns a pointer to an internal buffer
that is overwritten in the next API call.

We should change all of this code to use
support::detail::packed_endian_specific_integral like ELF, but since these
functions only handle strings, they work with big and little endian machines
as is.

I have tested this by installing ubuntu 12.10 ppc on qemu, that is why it took
so long :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170838 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
cd7ee1ced017d7a957113df9d6cf855ecbc3797e 19-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert 170545 while I debug the ppc failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170547 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f9a6bd8524ba16d3e4036304ffdc9475df6844f2 19-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Add r170095 back.

I cannot reproduce it the failures locally, so I will keep an eye at the ppc
bots. This patch does add the change to the "Disassembly of section" message,
but that is not what was failing on the bots.

Original message:

Add a funciton to get the segment name of a section.

On MachO, sections also have segment names. When a tool looking at a .o file
prints a segment name, this is what they mean. In reality, a .o has only one
anonymous, segment.

This patch adds a MachO only function to fetch that segment name. I named it
getSectionFinalSegmentName since the main use for the name seems to be infor
the linker with segment this section should go to.

The patch also changes MachOObjectFile::getSectionName to return just the
section name instead of computing SegmentName,SectionName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170545 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
1c2b2f9c56c01aa1c317da4fd0234eaa1fe6e739 17-Dec-2012 Tim Northover <Tim.Northover@arm.com> Teach MachO which sections contain code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170349 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
ef8581479e58fe092178a9727f373a61b690a8df 13-Dec-2012 Eric Christopher <echristo@gmail.com> Revert "Add a funciton to get the segment name of a section."

This reverts commit r170095 since it appears to be breaking the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170105 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
e3ec87a6f7b718596697727e699a62aed0d40b25 13-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Add a funciton to get the segment name of a section.

On MachO, sections also have segment names. When a tool looking at a .o file
prints a segment name, this is what they mean. In reality, a .o has only one,
anonymous, segment.

This patch adds a MachO only function to fetch that segment name. I named it
getSectionFinalSegmentName since the main use for the name seems to be informing
the linker with segment this section should go to.

The patch also changes MachOObjectFile::getSectionName to return just the
section name instead of computing SegmentName,SectionName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170095 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
9ee68e3f729e95a12e9f266a09e8ffdbaeda83f2 12-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove some dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169963 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
achOObject.cpp
achOObjectFile.cpp
f56c3e28b94545d7d7cf34d39d7ed87fae29d9be 29-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> Object: Pass the buffer name through when making a copy.

Should bring the buildbots back to life.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168935 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
596e474101ea9a8ecac9d8ee090d31469dbcc61d 29-Nov-2012 Jim Grosbach <grosbach@apple.com> Fix a memory leak in MachOObjectFile.

MachOObjectFile owns a MachOObj, but never frees it. Both MachOObjectFile
and MachOObj want to own the MemoryBuffer, though, so we have to be careful
and give them each one of their own.

Thanks to Greg Clayton, Eric Christopher and Michael Spencer for helping
figure out what's going wrong here.

rdar://12561773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168923 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
7af4b9b33a2bc3e95f78d8b5063a77035c86640d 14-Nov-2012 Matt Beaumont-Gay <matthewbg@google.com> s/assert/llvm_unreachable/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167936 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
f1c2a6b512c5e210c8571923663fe19c713ea45d 14-Nov-2012 Matt Beaumont-Gay <matthewbg@google.com> Fix broken asserts. Also, spell 'indices' correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167894 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
768a707fdfd0be3587864b9b9edcc74aa0acdf92 14-Nov-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Object] Fix endianess bug by refactoring Archive::Symbol::getMember.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167893 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
206252cc9f5509b27aa0761c677fdee8daff001c 13-Nov-2012 Shankar Easwaran <shankare@codeaurora.org> Adding changes to support GNU style archive library reading

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167853 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
a41dce3c642e50775352cce49e3a3d0cd004d393 29-Oct-2012 Tim Northover <Tim.Northover@arm.com> Add interface for querying object files for symbol values.

Currently only implemented for ELF.

Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166918 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
30b20ebdd3a41e103c6aa35849a33ed299332bc9 10-Oct-2012 Andrew Kaylor <andrew.kaylor@intel.com> Cosmetic changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165588 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
3a129c85920404e7ccdb7e655c89fa60a0309cfd 10-Oct-2012 Andrew Kaylor <andrew.kaylor@intel.com> This patch adds new functions to the SectionRef and ObjectFile interfaces to determine whether or not a section is meant to be read-only. These functions will be used by the MCJIT RuntimeDyld to give hints to the memory manager during the object loading process in a future patch.

Patch by Ashok Thirumurthi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165586 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
7744acd1ab73b3eec6f1449f47083abe3fb1b527 03-Aug-2012 Shih-wei Liao <sliao@google.com> Merge with LLVM upstream r160668 (Jul 24th 2012)

Conflicts:
include/llvm/Support/ELF.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Support/Memory.cpp
lib/Transforms/Instrumentation/AddressSanitizer.cpp

Change-Id: Iddd658cf2eadc7165b2805b446d31af2c5c9917f
7f5714f4392590e5a97113a18e1a4e9ad0315571 19-Jul-2012 Galina Kistanova <gkistanova@gmail.com> Reverting r 160419.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160525 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
d3a32b952b893c9799828fc2e8264385424f87ff 18-Jul-2012 Galina Kistanova <gkistanova@gmail.com> Fixed few warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160419 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
9ac0f1d7255d7941c331b0a62a830a3b033358fd 18-Jun-2012 Marshall Clow <mclow@qualcomm.com> Added accessors for getting coff_relocation info

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158675 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
45aad162c68ee58ba1aa8984499064f6b9c8d0f9 15-Jun-2012 Marshall Clow <mclow@qualcomm.com> Had a closing brace inside an #ifdef -- oops!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158485 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
d4d03e09d3686d317da1166b578ca5ca35593970 15-Jun-2012 Marshall Clow <mclow@qualcomm.com> Adding acessors to COFFObjectFile so that clients can get at the (non-generic) bits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158484 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
77592fe39c404f3c48b06fae48b965058b3a5ee8 09-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Convert comments to proper Doxygen comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158248 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
e32981048244ecfa67d0bdc211af1bac2020a555 24-May-2012 Craig Topper <craig.topper@gmail.com> Mark some static arrays as const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157377 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
achOObjectFile.cpp
3e96531186ba574b0c25a4be62d24b8b7d752c9f 18-May-2012 Jim Grosbach <grosbach@apple.com> Refactor data-in-code annotations.

Use a dedicated MachO load command to annotate data-in-code regions.
This is the same format the linker produces for final executable images,
allowing consistency of representation and use of introspection tools
for both object and executable files.

Data-in-code regions are annotated via ".data_region"/".end_data_region"
directive pairs, with an optional region type.

data_region_directive := ".data_region" { region_type }
region_type := "jt8" | "jt16" | "jt32" | "jta32"
end_data_region_directive := ".end_data_region"

The previous handling of ARM-style "$d.*" labels was broken and has
been removed. Specifically, it didn't handle ARM vs. Thumb mode when
marking the end of the section.

rdar://11459456

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157062 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
7c101d874ef1ef2053c6f61d87680006fdd1a32d 07-May-2012 Andrew Hsieh <andrewhsieh@google.com> Merge "Add libLLVMObject to read executable file."
41827f9ba2745cfe16d94775f6fd0803b0efef23 02-May-2012 Eli Friedman <eli.friedman@gmail.com> Fix the implementation of MachOObjectFile::isSectionZeroInit so it follows the MachO spec.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155976 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
ca8b2c655eb4d283187cbbb4f0f3acd34f60fa1c 20-Apr-2012 Logan Chien <loganchien@google.com> Add libLLVMObject to read executable file.

Change-Id: I9ce8742d12fd3d9c57cec182e76c7385d3f0e3bc
ndroid.mk
OFFObjectFile.cpp
LFObjectFile.cpp
689ff9c00f4f3dcf3491778bcdbda79e19e2285d 17-Apr-2012 Preston Gurd <preston.gurd@intel.com> Implement GDB integration for source level debugging of code JITed using
the MCJIT execution engine.

The GDB JIT debugging integration support works by registering a loaded
object image with a pre-defined function that GDB will monitor if GDB
is attached. GDB integration support is implemented for ELF only at this
time. This integration requires GDB version 7.0 or newer.

Patch by Andy Kaylor!




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154868 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
8fc7d5c35cc79f941d2eb8e992133f94f375670a 13-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154661 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
c68dda815e64fb2fb463318d1eaa304e22199d50 12-Apr-2012 Preston Gurd <preston.gurd@intel.com> This patch improves the MCJIT runtime dynamic loader by adding new handling
of zero-initialized sections, virtual sections and common symbols
and preventing the loading of sections which are not required for
execution such as debug information.

Patch by Andy Kaylor!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154610 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
3fd9b8422328a60664a5c631ec9519b58017fcbc 10-Apr-2012 Danil Malyshev <dmalyshev@accesssoftek.com> Add a constructor for DataRefImpl and remove excess initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154371 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
70debecde6213620ac741e0fea1085c9c90fa8d9 03-Apr-2012 Dylan Noblesmith <nobled@dreamwidth.org> Object: drop bogus VMCore dependency

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153956 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
1f6e3f9544c93213111a2f8b314c926c0d0e30e5 19-Mar-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Object/COFF]: Expose getSectionContents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153051 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
b35a896e072ff46c38905419b7f55aaccdb1d702 19-Mar-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Object/COFF]: Expose getSectionName.
Also add some documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153050 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
33a1805f352acf00662b8e3f8ef178bf2cbbd919 15-Mar-2012 Michael J. Spencer <bigcheesegs@gmail.com> Fix bug found by warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152812 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
6f9489a86f33624f9ff5388411d12359ce9cef20 09-Mar-2012 David Meyer <pdox@google.com> [Object]
Make Binary::TypeID more granular, to distinguish between ELF 32/64 little/big




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152435 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
OFFObjectFile.cpp
achOObjectFile.cpp
97f7787bfb56ad31fe20ec0bb9c3c9f3253d14fb 01-Mar-2012 David Meyer <pdox@google.com> [Object]
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151845 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
5c2b4ea73c8f48bb5f96c86fe437385b8fb3dcda 01-Mar-2012 David Meyer <pdox@google.com> [Object]
* Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile.
* Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable.
* Implement this new interface completely for ELF, leave stubs for COFF and MachO.
* Add 'llvm-readobj' tool for dumping ObjectFile information.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151785 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
2c67727046234ad9702ab5acb72700b5ac99a676 29-Feb-2012 David Meyer <pdox@google.com> [Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ST_Undefined. Implement these completely for ELF.
Rename ST_External to ST_Unknown, and slightly change its semantics. It now only indicates that the symbol's type
is unknown, not that the symbol is undefined. (For that, use ST_Undefined).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151696 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
c46255a32ec92c427e621b6d7eabd887962ce4a4 29-Feb-2012 David Meyer <pdox@google.com> In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151670 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
dfa1896b6b61e708f002b814794890ff308172ee 28-Feb-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.
Add -D option to llvm-nm to dump dynamic symbols.

Patch by David Meyer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151600 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
achOObjectFile.cpp
e1a4427ccb6e29e63c11e63224460a92ee66de37 22-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove static ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151160 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
f4eff4baeb44f9dee988e9293d029dcaa359420d 12-Feb-2012 Eli Bendersky <eli.bendersky@intel.com> Expose the ELFObjectFile class directly in the Object/ELF.h header, similarly
to what's done for MachO and COFF. This allows advanced uses of the class to
be implemented outside the Object library. In particular, the DyldELFObject
subclass is now moved into its logical home - ExecutionEngine/RuntimeDyld.

This patch was reviewed by Michael Spencer.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150327 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
069df954a1270cacbd477357dfbf116d47fdf254 04-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Object: avoid undefined behavior when bounds-checking

Don't form an out of bounds pointer just to test if it
would be out of bounds.

Also perform the same bounds checking for all the previous
mapped structures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149750 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
7f64823edbe11a0df2fc36efde8b013ca2051231 24-Jan-2012 Matt Beaumont-Gay <matthewbg@google.com> Sink assert-only variables into the asserts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148849 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
ee705a73f6465244a4eef0e6c4f930f87c160a6a 23-Jan-2012 Matt Beaumont-Gay <matthewbg@google.com> Silence warnings in -asserts build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148715 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
b2798fab4ef8d0e0edb349da2c7236e18e00c5b9 22-Jan-2012 Eli Bendersky <eli.bendersky@intel.com> Remove trailing spaces



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148654 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
24973c1063bfb7ac353732a4e8eb801830336c5f 22-Jan-2012 Eli Bendersky <eli.bendersky@intel.com> Basic runtime dynamic loading capabilities added to ELFObjectFile, implemented
in a subclass named DyldELFObject. This class supports rebasing the object file
it represents by re-mapping section addresses to the actual memory addresses
the object was placed in. This is required for MC-JIT implementation on ELF with
debugging support.

Patch reviewed on llvm-commits.

Developed together with Ashok Thirumurthi and Andrew Kaylor.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148653 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
aba65b05fc5dd8649725431e38359b7fa1ab59e8 25-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147261 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
2d24e2a396a1d211baaeedf32148a3b657240170 20-Dec-2011 David Blaikie <dblaikie@gmail.com> Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
bjectFile.cpp
4ab406d7fc06b1272d02cd8be46f0c5ebe51a3da 12-Dec-2011 Daniel Dunbar <daniel@zuster.org> LLVMBuild: Remove trailing newline, which irked me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
d782bae970e888572f0458ac05369bbd7752f05a 29-Nov-2011 Daniel Dunbar <daniel@zuster.org> build/CMake: Finish removal of add_llvm_library_dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
b0436a73054fe676b216a0cf872d1fc433125c62 29-Nov-2011 Danil Malyshev <dmalyshev@accesssoftek.com> Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145408 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
a483fc8e6f9533317f517f2d03f3a41ec0aee663 28-Nov-2011 Daniel Dunbar <daniel@zuster.org> Fix some possible gcc-4.2 may be used uninitialized warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145292 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
790552c20fbd8daa77d343419f0f6ec4e7fa1457 27-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Revert r145180 as it is causing test failures on all the bots.

Original commit message:
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145182 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
9b24738bd1dc791eb2c21b5562fcfe4b7b99fe2a 27-Nov-2011 Danil Malyshev <dmalyshev@accesssoftek.com> Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145180 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
11ba26db13698a4567730be13a154c5690ef5e75 17-Nov-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/COFF: Support common symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144861 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
b8ebca83f4dff04ba21cc97673003f0bd35a2e49 12-Nov-2011 Daniel Dunbar <daniel@zuster.org> build: Attempt to rectify inconsistencies between CMake and LLVMBuild versions of explicit dependencies.
- The hope is that we have a tool/test to verify these are accurate (and tight) soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144444 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
7151ddd6efb2f3f51297b35f27a30ddfa8a76a7e 09-Nov-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/COFF: Fix PE reading.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144148 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
ef56d1d35d741da0de6e27717d51564eade63e6d 05-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> MachOObject: Use DataExtractor's uleb parser instead of rolling our own.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143810 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
efd2d5e1c48e9e530d2323123d28120f50dfed76 04-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143695 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
a3a2dfd4a2a8265a9a0c962cb776e2e6ba123956 03-Nov-2011 Daniel Dunbar <daniel@zuster.org> build: Add initial cut at LLVMBuild.txt files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
eefb0de6dc383faa2d95536ac5e9deb71958d953 03-Nov-2011 Chad Rosier <mcrosier@apple.com> Removed unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143591 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
783d88793afe4b4e42460c139ab742fbd26f39f7 02-Nov-2011 Michael J. Spencer <bigcheesegs@gmail.com> object/COFF: Properly initalize uses of DataRefImpl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143562 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
c8a55a660e93bb7a4854969b4c5814bf7bb0101b 02-Nov-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/Archive: Add symbol table iteration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143561 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
b28bdbf8468e728501828fd41b3f2dba8db62efa 27-Oct-2011 Owen Anderson <resistor@mac.com> If we're searching for a symbol reference to pretty-print a scattered relocation address, and we don't find a symbol table entry, try section begin addresses as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143151 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
eb6bd339954376e4ab1fda52133ef3f94c3029b7 27-Oct-2011 Owen Anderson <resistor@mac.com> Fix pretty printing of i386 local sect diff relocations, TLV relocations, and x86_64 TLV relocations in MachO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143140 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
3529c53d2f07bb283e990d1678962f1b5eba9ba4 27-Oct-2011 Owen Anderson <resistor@mac.com> Expose relocation accessors through the libObject C API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143109 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
d8b0b915c5a94806596c381660c548aabef447b2 27-Oct-2011 Owen Anderson <resistor@mac.com> Add relocation iterators to the libObject C API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143107 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
1832f4d94eb292d63824eaa043118ed6cc61389b 26-Oct-2011 Owen Anderson <resistor@mac.com> Add support for scattered relocations to the MachO relocatation pretty printer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143051 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
ef22f78c68d3f096b3c8aac2752ca8e3e25106a6 26-Oct-2011 Owen Anderson <resistor@mac.com> The order of the two symbol listings in a Macho x86_64 subtractor relocation is reversed from what seems intuitive to me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143035 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
f8261e7d07a8994e08cdba9f0e336e645daf104c 26-Oct-2011 Owen Anderson <resistor@mac.com> Include the full 64 bits of relocation data in the type info for MachO relocations, so that we can recognize scattered relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143033 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
9472b8d220fc746498429f430cb4c4dbfbd38f2a 26-Oct-2011 Owen Anderson <resistor@mac.com> Expand relocation type field to 64 bits. MachO scattered relocations require 33 bits of type info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143032 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
929e27cc3c67d4c6355c7b56b2983722d28d2624 26-Oct-2011 Owen Anderson <resistor@mac.com> Improve pretty printing of GOT relocations in MachO on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143031 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
b64541fc7285c7305c6df7a83e4514a89bdaaa7b 26-Oct-2011 Eric Christopher <echristo@apple.com> Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143011 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
fe944e8cd03701b699c07590b4ec5203928b2b11 26-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/Archive: Cleanup anon namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142983 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
aaf98ead114bcd51cd2479badfe28b8d0e4895c2 26-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/Archive: Add BSD style long file name support and skip internal members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142981 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
c8aa726ec22a362bf9fe0d81fdcf68a48bfc999f 25-Oct-2011 Owen Anderson <resistor@mac.com> Remove extraneous printing of "-PC".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142970 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0685e94895f26f96aa1032696e3150dd00aad1f3 25-Oct-2011 Owen Anderson <resistor@mac.com> Add support for the notion of "hidden" relocations. On MachO, these are relocation entries that are used as additional information for other, real relocations, rather than being relocations themselves.
I'm not familiar enough with ELF or COFF to know if they should have any relocations marked hidden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142961 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
013d756310a92fd358a9aab2a63cce52c107f777 25-Oct-2011 Owen Anderson <resistor@mac.com> Teach the MachO relocation pretty-printer to interpret ARM half-relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142938 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
d8fa76d4bed067cd8662c3196211bc90cc8d4470 25-Oct-2011 Owen Anderson <resistor@mac.com> More fixes and improvements to MachO relocation pretty-printing, particular for x86 and x86_64 relocations with addends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142875 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0135fe1854bef035efea1e3113dc6a127ef6e51e 24-Oct-2011 Owen Anderson <resistor@mac.com> Get relocation parsing/dumping to a mostly-working state for MachO files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142852 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
5f4e02cbf1d0fa0d8048369264201c258f2ad717 24-Oct-2011 Owen Anderson <resistor@mac.com> Stub out some of the MachO relocation decoding hooks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142840 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
ca7eb3e171f63de3cfc1020d86375ce11d356194 21-Oct-2011 Owen Anderson <resistor@mac.com> Use LLVMBool for a function that logically returns a boolean value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142683 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
a48aab924d93be3cdb4a230a9158d210b97b3f56 21-Oct-2011 Owen Anderson <resistor@mac.com> STABS symbols are debug symbols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142673 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
e2fa64ef22321c5771667a8f00dca737ecb0799c 21-Oct-2011 Owen Anderson <resistor@mac.com> Bind libObject API for obtaining the section containing a Symbol.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142667 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
3cb056797b17785cfd2429ce8232143d5aeb5e42 21-Oct-2011 Owen Anderson <resistor@mac.com> Expand the coverage of the libObject C bindings to include more SectionRef accessors as well as Symbol iterators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142661 91177308-0d34-0410-b5e6-96231b3b80d8
bject.cpp
7c24665390a79ee05a0a562ff689e52d4135063e 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/COFF: Remove useless test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142408 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
5e3a082c797f0214d44858b05a13543872dfd413 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/COFF: Change type from a struct to a uint16_t. The struct would be
incorrect for bigendian systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142403 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
206d17cf605293f1c12d8bfa8cf72826a29b253f 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add some types to SymbolRef::Type.

Some of these can be true at the same time and there are a lot to add,
so this should be turned into a bitfield. Some of the other accessors
should probably be folded into this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142318 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
9b2b812fea4df160437e7b7d56e38f6335189ad0 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add isSymbolAbsolute and getSymbolSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142317 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
c38c36a8c44bd32bdfc2e48ab3e447f6dc1547bd 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add isSymbolWeak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142316 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
0e752cb4b4eb5676aace4d9f3d7c2e2334c13777 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object/COFF: Expose more data in the public API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142315 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
ab6bcf35aefe823894d349773ebd53f465f122b7 18-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Implement casting for concrete classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142314 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
1130a799ab2fd7042625163a2506518960394884 17-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Fix redundant name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142238 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
63b2f8c710ec42aa5304cbe8a5e8013e3ac66b8e 14-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> ELF: Fix the section that relocations apply to. Add test to verify. Patch by Danil Malyshev!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141901 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
bff6f8679a3e4006653157ca11cee9dc58c68f8b 13-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> COFF: Implement sectionContainsSymbol for relocatable files only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141884 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
f77dea13d7cd803b2e928808612cd0419e3f4122 13-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Elf_Word is not POD! Stop using it in a DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141851 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
95f8db4d4d0110182d721586a006748b30e4fc82 13-Oct-2011 Owen Anderson <resistor@mac.com> The VMAs stored in the symbol table of a MachO file are absolute addresses, not offsets from the section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141828 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
10a8c62d46bca8632fd827f3afc13235d81e47fd 13-Oct-2011 Owen Anderson <resistor@mac.com> Don't label a STAB debugging symbol as a function symbol.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141824 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
cd74988fb94ffc180196fed9aa2c8ee548915f86 13-Oct-2011 Owen Anderson <resistor@mac.com> sectionContainsSymbol needs to be based on VMA's rather than section indices to properly account for files with segment load commands that contain no sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141822 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
41242942fcbb2e6bc4e5bed3e8041f7b20ece8af 12-Oct-2011 Owen Anderson <resistor@mac.com> Section indices in MachO symbol tables begin at 1, not 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141815 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
18dcb87f6beb228011545e0210c842d6741d5805 12-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Object/ELFObjectFile.cpp: Fix undefined behavior for MC/ELF/many-section.s not to fail (on msvc).

DenseMap::lookup(k) would return "default constructor value" when k was not met. It would be useless when value type were POD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141774 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
f7c93a3867b45e42db6927536f76e7d2869ead60 11-Oct-2011 Owen Anderson <resistor@mac.com> Expose MachOObjectFile externally, like we do for COFF. First step in reducing the amount of special-purpose code needed for llvm-objdump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141684 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
bfbbe328371772a1b8408066f976a374b379e684 11-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Reapply r141605 with fixes for appropriate handling of reserved section numbers
in st_shndx fields.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141639 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
15c3f727aeff6a80e3f9e7e6b1284748e5f3322a 11-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Add support for .symtab_shnidx. Unfortunately, doing this required breaking a
layer of abstraction around SymbolRef where you can read its private
SymbolPimpl member.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141636 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
fb05d3d68669859c32bd738f5b5b008e4c4fcf69 11-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Revert r141605 as it broke tests for llvm-nm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141614 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
fad138dd79d025229433c9de90108df4eb81f4af 11-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Add support for reading many-section ELF files.
If you want to tackle adding the testcase, let me know. It's a 4.2MB ELF file
and I'll be happy to mail it to you.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141605 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
15565ad758ae28f21a1f8bbcc92fac49482bd820 11-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Fix warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141597 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
e2f2f07be7cf2b55b7e5501291bbcede87e43fd6 10-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: add getSectionAlignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141581 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
48f248ad5f9e435f3aeaa3aa9bca890687085540 08-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Object: Suppress warnings on gcc-4.3.4 cygwin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141485 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
OFFObjectFile.cpp
c6500a5d77159e9c9a9f1f8f56307a0016f229a0 08-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add support for opening stdin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141449 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
5861893c25ee9ee6bb2991057169c0cb1e1331e0 08-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: constize Archive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141448 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
01a4db3ed4d199da33fa1ce0e1c7b7b9b1c3ccdf 07-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Fix GCC again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141389 91177308-0d34-0410-b5e6-96231b3b80d8
LFObjectFile.cpp
4344b1ef9b3721a5ebc2e024f753772a1e4ddd92 07-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Change relocation API to be per section. This time without breaking GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141385 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
a48ad1333999e2fb483d23096349138af5a51ec6 07-Oct-2011 Bill Wendling <isanbard@gmail.com> Revert 141376 and 141377 due to breaking the build.

--- Reverse-merging r141377 into '.':
U tools/llvm-objdump/MachODump.cpp
--- Reverse-merging r141376 into '.':
U include/llvm/Object/COFF.h
U include/llvm/Object/ObjectFile.h
U include/llvm-c/Object.h
U tools/llvm-objdump/llvm-objdump.cpp
U lib/Object/MachOObjectFile.cpp
U lib/Object/COFFObjectFile.cpp
U lib/Object/Object.cpp
U lib/Object/ELFObjectFile.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141379 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
f1164a2487750f891694fc2e3347860e50f705fb 07-Oct-2011 Michael J. Spencer <bigcheesegs@gmail.com> Change relocation API to be per section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141376 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bject.cpp
13afc5eff2d7370ab486d5039886ab8bbf9039da 28-Sep-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add isSection{Data,BSS}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140721 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
a51d7d97b0b8187ed68d4cbad2374f514d2cd168 27-Sep-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add archive support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140626 91177308-0d34-0410-b5e6-96231b3b80d8
rchive.cpp
inary.cpp
MakeLists.txt
ac241fe9f0d73c6f632e4f7f89e06b698d39da54 14-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Object: make the following changes into SymbolRef

- Add enum SymbolType and function getSymbolType()
- Add function isGlobal() - it's returns true for symbols that can be used in another objects, such as library functions.
- Rename function getAddress() to getOffset() and add new function getAddress(), because currently getAddress() returns section offset of symbol first byte. new getAddress() return symbol address.
- Change usage SymbolRef::getAddress() to getOffset() in tools/llvm-nm and tools/llvm-objdump.

Patch by Danil Malyshev!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139683 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
836623420dbf5eb3a3facde2841179ded91ab55b 14-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> ObjectFile: Add support for mach-o-style dSYM companion files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139676 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
cee58a69fa3f0f291c0c88ce0d29099a95495ae7 13-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence false positive uninitialized variable warnings from GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139573 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
d40b0b0a0632d4b20631ac2196e0a07abb704343 09-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139343 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
58856eae1629f7176f2dbde822bb4220773f72fc 09-Sep-2011 Nick Lewycky <nicholas@mxc.ca> Fix release build:
MachOObjectFile.cpp:524: error: unused variable 'NumLoadCommands' [-Wunused-variable]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139341 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
0fcab076f0358890e2f1b213f4303c780e05d99d 08-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Add support for relocations to ObjectFile.

Patch by Danil Malyshev!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139314 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
d4522460d495fb0be3303f0727f9bd00867c0b16 31-Aug-2011 Benjamin Kramer <benny.kra@googlemail.com> Teach macho-dump to dump the uleb128s referred to by linkedit_data segments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138836 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
9942acab0a42755637a682308c8262b88cbbb9e9 30-Aug-2011 Benjamin Kramer <benny.kra@googlemail.com> Teach macho-dump how to dump linkedit_data load commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138807 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
ac03e736c77bcf7e8deb515fc16a7e55d343dc8d 29-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.

I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.

This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.

This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.

Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.

This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136433 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
07ea23aa2d17f701fa125442c20c1eba75b55fdb 15-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> ObjectFile: Add a method to check whether a section contains a symbol.

- No ELF or COFF implementation yet, I don't have a way to test that.
Should be straightforward to add though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135288 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
32fb2af67988348f9f341005c35b1ed544d13265 15-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> MachOObjectFile: Get symbol functions ready for 64 bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135282 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
291e767dcf19d60b8e774114efc6e10f2e022844 15-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Output MachO section names in the form SEGMENT,section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135231 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
7d145789c01f9a1863ea02574bc3f9567c8a33fa 15-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Add support for 64 bit objects to MachOObjectFile.

- I don't see a better way than duplicating all the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135229 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
82ba5b7c40add3d8d7516d81b9ff288545b821fc 15-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> MachOObjectFile: Change isSectionText to return true for sections named text, not for load commands name __TEXT (which isn't the case in actual object files)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135228 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
3209a03dafe1a23fe74c933cebd9f9c92a2a3616 05-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Use memcmp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134439 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
9b9c5ea2c396806fc85c3502cf0205b4e03c2233 05-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> Really fix typo :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134436 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
5ac795c56f27735085be5500a1b43f09ceb2bfc9 05-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134433 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
82c475d0579e2d7519bdf75b3efa44f6b9759c21 05-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> Compare all 4 bytes of the header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134427 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
64388ceee00d5e8fc8750ce7967c07a83af3a5a8 05-Jul-2011 Michael J. Spencer <bigcheesegs@gmail.com> Fix warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134408 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
25b15777df42d5d608810f6881b6c98107481d69 25-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add proper error handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133872 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
rror.cpp
achOObjectFile.cpp
bject.cpp
001c9205fca2220480589ec355cb6ec701a37e08 25-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Make Binary the parent of ObjectFile and update children to new interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133870 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bjectFile.cpp
c44c915372ee453bd63a8b6b3eca586ab6f18545 25-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Add Binary class. This is a cleaner parent than ObjectFile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133869 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
MakeLists.txt
d2a02f409e20f64a33e5dc55926e97bd710386c8 25-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Add Object/Error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133868 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rror.cpp
aa99bea46f69f9cc46f3f50f2cb19e801641ed97 13-Jun-2011 Benjamin Kramer <benny.kra@googlemail.com> Revert r132910 and r132909 on behalf of Michael. They didn't build with clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132914 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
MakeLists.txt
rror.cpp
5e45dc40d329829ad23bf444f32dca221215e239 13-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Revert the last two commits in the series. r132911, r132912.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132913 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bjectFile.cpp
69aec36f9b3129ba6eb83d64cde31c3d86d6d39a 13-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Make Binary the parent of ObjectFile and update children to new interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132911 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
OFFObjectFile.cpp
LFObjectFile.cpp
achOObjectFile.cpp
bjectFile.cpp
fc9ec691da995e7894490a80f5b6b65daf5e34d3 13-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Add Binary class. This is a cleaner parent than ObjectFile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132910 91177308-0d34-0410-b5e6-96231b3b80d8
inary.cpp
MakeLists.txt
bf58996c086fe4993ae778adb838d230ced06068 13-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Add Object/Error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132909 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rror.cpp
cbda61a468b4a2b33a54781d65023da7d9c8d291 13-Jun-2011 Michael J. Spencer <bigcheesegs@gmail.com> Fix spelling and sort CMakeLists.txt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132908 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
71f234ba6a2e37ee6d56aa7ed8f09105fd0517f9 02-May-2011 Nick Lewycky <nicholas@mxc.ca> Remove dead variable pointed out by GCC 4.6 warnings, and reflow this a little
to scope a variable more tightly per llvm coding style. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130684 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
f4b2f933a98e402083134f710a5d247c42e39ed5 22-Apr-2011 Eric Christopher <echristo@apple.com> Use enums for constant values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129984 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
9ab1d7f9b2d4caf1b8a5af91b74a7b13f1ac8986 22-Apr-2011 Eric Christopher <echristo@apple.com> Make the file format strings a little prettier for mach-o.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129980 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
860d7e182a4f1f769ac6d5620851d031f6c8c2ac 22-Apr-2011 Eric Christopher <echristo@apple.com> Add MachOObjectFile.cpp to cmake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129978 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ea7e13eded163bcae97a976847df91b7a0da2b01 22-Apr-2011 Eric Christopher <echristo@apple.com> Hook in mach-o object files into Object interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129976 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
6256b03674f4d50d1c035aa3ecba45df1345ea79 22-Apr-2011 Eric Christopher <echristo@apple.com> Add an ObjectFile implementation for mach-o.

Patch by Patrick Walton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129974 91177308-0d34-0410-b5e6-96231b3b80d8
achOObjectFile.cpp
592cf78f842999d3b6c958822927790bc3f45c62 04-Apr-2011 Eric Christopher <echristo@apple.com> Start migrating mach-o dumping facilities to the object file out of a
separate executable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128801 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
33feb706901bc674d30e9d82b6baff7e9c634366 04-Apr-2011 Eric Christopher <echristo@apple.com> Move Object.cpp out of VMCore and into Object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128800 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bject.cpp
539d8d8a72995d08afe7b986fe98a1dc7fec4b0a 04-Apr-2011 Eric Christopher <echristo@apple.com> Assorted bugfixes in object file handling:

- Adds support for sniffing PE/COFF files on win32 (.exe and .dll)
which are COFF files that have an MS-DOS compatibility stub on
the front of them.

- Fixes a bug in the COFFObjectFile's support for the Microsoft COFF
extension for long symbol names, wherein it was attempting to parse
the leading '/' in an extended symbol name reference as part of the
integer offset.

- Fixes bugs in COFFObjectFile and ELFObjectFile wherein section
and symbol iterators were being returned with uninitialized bytes;
the type DataRefImpl is a union between 2 32-bit words (d.a and d.b)
and a single intptr_t word (p). Only p was being initialized, so in
32-bit builds the result would be iterators with random upper 32-bit
words in their DataRefImpls. This caused random failures when
seeking around in object files.

Patch by Graydon Hoare!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128799 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
7acdb4d237181976b04e72f6a6c329c3b2604440 21-Jan-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Fix type punned pointer issues by making DataRefImpl a union and using intptr_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123962 91177308-0d34-0410-b5e6-96231b3b80d8
OFFObjectFile.cpp
LFObjectFile.cpp
b84551a14f1c96942eb82408652e633543b0961e 20-Jan-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add ELF support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123896 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
LFObjectFile.cpp
bjectFile.cpp
a1ef8ef66075e28e020e5d2f408e0a9bae9eb9d3 20-Jan-2011 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add COFF Support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123895 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
OFFObjectFile.cpp
bjectFile.cpp
23dcd00edeea556d26eed0cd2b3807dbd44107ab 17-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> Fix mismatched new[]/delete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122053 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
3ff9563c3e391954b2e224afcf8b2b0fcc3888aa 16-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
a87d7ec234e1d4a31f4403ee9495d7700e6a593c 10-Dec-2010 Daniel Dunbar <daniel@zuster.org> Mach-O: Tweak field name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121465 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
333fb04506233255f10d8095c9e2de5e5f0fdc6f 09-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
1f6efa3996dd1929fbc129203ce5009b620e6969 29-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Merge System into Support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
bjectFile.cpp
71130f8aa1cef096083b95267a8a688a3bef6426 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for --dump-section-data and tweak a few format strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120219 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
2208b58b83392b2a3558e556c7447b13c3aea857 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping symbol table entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120218 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
f2e2a5ff04e13720cec0c130c1d88d81d0ae6007 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping string table data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120217 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
90e3e3a429e75a7d3671afcc30ed376b6186fd58 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping relocation entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120216 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
2acadbddf6783055249da9fc9ea40a05b83ce56a 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120215 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
4c55e0db0f0a095dcd76326bef24d0fe05d2a5e4 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping dysymtab indirect symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120214 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
3946e3b4764ab0146693aad53687d33b7ae6bb78 27-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Unbreak build for newer GCCs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120205 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
f879f14cef93fe51ee8c180be7acf70294807b8f 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping symtab and dysymtab commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120204 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
4ba1f5e0011fa0c17ff121634bf8e88270f3b52e 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> macho-dump: Add support for dumping segment load commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120203 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
a956d8b71755b908d8a150736e8857d2214060c6 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> Object/Mach-O: Add header and load command information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120198 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
95369163f58f06a6494ca9623184a8849ecf85f3 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> Object/Mach-O: Validate Mach-O magic and initialize format info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120195 91177308-0d34-0410-b5e6-96231b3b80d8
achOObject.cpp
fbd25b7d1d030ca0cbea28c690b636c35299826e 27-Nov-2010 Daniel Dunbar <daniel@zuster.org> MC/Mach-O: Start stubbing out a Mach-O object file wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120190 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
achOObject.cpp
b1a33c4a598d67a9b911bb3b45b379e36fb9396c 17-Nov-2010 Peter Collingbourne <peter@pcc.me.uk> Fix typo: Exectuable -> Executable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119433 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
88af6b9217f9ff8b4592f38ac5175de697275f49 16-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Object: Get rid of sys::Path, Triple, and cleanup namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119309 91177308-0d34-0410-b5e6-96231b3b80d8
bjectFile.cpp
0a5b64ea1050ce56d689cd687a9f7feaa43d550d 15-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Object: Add missing makefile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119110 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
68b3f0c40e29e461dbbc85370078692df4336b42 15-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Add LLVMObject Library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119107 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bjectFile.cpp