Commit Graph

5997 Commits

Author SHA1 Message Date
Rafael Espindola
9ed0d629ce Remove getStaticSymbolName.
Every user now keeps track of the correct string table to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 18:04:29 +00:00
Rafael Espindola
a33feabe7a Remove always false parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242802 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:42:01 +00:00
Rafael Espindola
51ac821430 Use range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:40:14 +00:00
Rafael Espindola
7eeb71ddc3 Replace the last uses of ELF::getSymbolName in llvm-readobj.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:26:21 +00:00
Rafael Espindola
9ea117379c Use helper function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242795 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:05:53 +00:00
Rafael Espindola
fcadda639e llvm-readobj: use the associated string table to print symbols. NFI.
This just removes some cases that require ELFFile to eagerly parse the ELF
file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:02:10 +00:00
Chris Bieneman
791500fa0d [CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified.
One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 15:53:09 +00:00
Rafael Espindola
71e35258cb Simplify printing the soname. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 13:48:41 +00:00
Rafael Espindola
ed3c543ddb Add missing c++ marker to .h file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 13:42:38 +00:00
Rafael Espindola
bb418bc23b Remove duplicated code.
Both ELFObjectFile and ELFFile had an implementation of getLoadName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242725 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:41:44 +00:00
Rafael Espindola
0377a22491 Simplify now that we can iterate backwards. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242715 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 21:45:56 +00:00
Chris Bieneman
4ee8a184ee [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Re-landing r242059 which re-landed r241621... I'm really bad at this.

Summary (r242059):
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Summary (r241621):
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 20:36:06 +00:00
Rafael Espindola
1c12cc02fd Remove Elf_Rela_Iter and Elf_Rel_Iter.
Use just the pointers and check for invalid relocation sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 20:07:50 +00:00
Rafael Espindola
9a4133e1ee Simplify iterating over program headers and detect corrupt ones.
We now use a simple pointer and have range loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 13:35:33 +00:00
Rafael Espindola
fa1a4b2275 llvm-readobj: Handle invalid references to the string table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242658 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 03:38:17 +00:00
Rafael Espindola
d60ced8e08 llvm-readobj: call exit(1) on error.
llvm-readobj exists for testing llvm. We can safely stop the program
the first time we know the input in corrupted.

This is in preparation for making it handle a few more broken files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 03:23:55 +00:00
Rafael Espindola
b9adbd998f Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 03:01:49 +00:00
Davide Italiano
ac018543f8 [llvm-cxxdump] Don't rely on global state
Differential Revision:	http://reviews.llvm.org/D11227


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17 06:18:36 +00:00
Rafael Espindola
5404f6983a Delete an unused function.
Patch by Xan López!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 18:41:41 +00:00
Rafael Espindola
ba7661d294 For new archive member we only need to store the full path.
We were storing both the path and the file name, which was redundant
and easy to get confused up with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242347 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 22:46:53 +00:00
Rafael Espindola
a0458b67ae Simplify a few uses of remove_filename by using parent_path instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 21:24:07 +00:00
Rafael Espindola
8d1daf644b Handle the error of trying to convert a regular archive to a thin one.
While at it, test that we can add to a thin archive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 20:45:56 +00:00
Rafael Espindola
4c9cd28947 Initial support for writing thin archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15 05:47:46 +00:00
Rafael Espindola
7a6e3434ba Add support for reading members out of thin archives.
For now the Archive owns the buffers of the thin archive members.
This makes for a simple API, but all the buffers are destructed
only when the archive is destructed. This should be fine since we
close the files after mmap so we should not hit an open file
limit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 22:18:43 +00:00
Rafael Espindola
6e9f427cb2 llvm-ar: Don't try to extract from thin archives.
This matches the gnu ar behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242162 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 16:55:13 +00:00
Rafael Espindola
4daa23f9a7 llvm-ar: print an error when the requested member is not found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 16:02:40 +00:00
Rafael Espindola
7ad2fa37a9 Use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242153 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 15:22:42 +00:00
JF Bastien
c20f89496e Revert "Fix llvm-config to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components."
This reverts commit 01446706b4.

Causes breakage, seems to be related to 'svn' in the file's name:

  CC=gcc CXX=g++ \
  ../llvm/configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-shared \
    --enable-libffi \
    --enable-targets=all \
    --disable-assertions \
    --with-python=/usr/bin/python2 \
    --enable-optimized

  make REQUIRES_RTTI=1 ENABLE_PIC=1

results:
llvm[2]: Linking Release unit test Support (without symbols)
llvm[2]: ======= Finished Linking Release Unit test Support (without symbols)
make[3]: Entering directory '/build/llvm-svn/src/build/bindings/ocaml/llvm'
make[3]: *** No rule to make target '/build/llvm-
svn/src/build/Release/lib/ocaml/libLLVM-3.7.0svn.so', needed by 'build-
deplibs'.  Stop.
make[3]: *** Waiting for unfinished jobs....
llvm[3]: Compiling llvm_ocaml.c for Release build
make[3]: Leaving directory '/build/llvm-svn/src/build/bindings/ocaml/llvm'
/build/llvm-svn/src/llvm/Makefile.rules:880: recipe for target 'all' failed
/build/llvm-svn/src/llvm/Makefile.rules:965: recipe for target 'all' failed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 15:10:34 +00:00
Rafael Espindola
6d0b72637c Use std::make_tuple to reduce code duplication.
Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242074 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 22:01:02 +00:00
Rafael Espindola
168b1bebf0 Add support deterministic output in llvm-ar and make it the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242061 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 20:38:09 +00:00
Chris Bieneman
7d41350722 Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242060 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 20:30:58 +00:00
Chris Bieneman
8d539b5519 [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Summary:
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Original Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242059 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 20:23:15 +00:00
Keno Fischer
a2485a49e8 [CMake] Add missing DebugInfo libraries to llvm-shlib
Reviewers: beanz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242054 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 19:41:51 +00:00
Pawel Bylica
c1a7ff9044 [llvm-stress] Remove unneeded llvm:: prefix. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 11:25:56 +00:00
JF Bastien
01446706b4 Fix llvm-config to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components.
Summary:
This fixes `llvm-config` instead of fixing the makefiles because, AIUI, LLVM's autoconfig/make build system is on the way out anyway.

This change only affects builds that use autoconfig/make.

Reviewers: jfb

Subscribers: echristo, dschuff, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241938 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 20:24:17 +00:00
Pawel Bylica
8229e332bd [llvm-stress] Enhance scalar type selection from command line.
llvm-stress command line options like -generate-x86-fp80 has been replaced with one list-like option -types. E.g. llvm-stress -types=x86_fp80,i100,i256,half. Default types (i1, i8, i16, i32, i64, float, double) are always added at the beginning of that list.

Reviewers: hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241896 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 10:01:47 +00:00
David Majnemer
eddf9e2057 Revert the new EH instructions
This reverts commits r241888-r241891, I didn't mean to commit them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241893 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 07:15:17 +00:00
Daniel Jasper
d09a1e42ca Add missing 'const'. I don't think this is strictly required, but some
compiler configuration is giving me an error and it seems to be
recommended anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241892 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 07:09:20 +00:00
David Majnemer
751c4be705 New EH representation for MSVC compatibility
Summary:
This introduces new instructions neccessary to implement MSVC-compatible
exception handling support.  Most of the middle-end and none of the
back-end haven't been audited or updated to take them into account.

Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 07:00:44 +00:00
Michael J. Spencer
8109763d68 [Object][ELF] Support dumping hash-tables from files with no section table.
This time without breaking the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241869 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 22:32:24 +00:00
Reid Kleckner
827f211e95 Expose sjlj preparation through opt for my own debugging purposes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241864 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 21:48:40 +00:00
Rafael Espindola
377796abdf Create BSD archives by default on OS X.
They should probably be created on anything that is not windows or linux, but I will
test on freebsd before changing that.

With this it is possible to bootstrap with llvm-ar instead of ar+ranlib on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241849 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 20:12:50 +00:00
Simon Atanasyan
13c5e09c6e [llvm-readobj] Print MIPS PLT table
Now the -mips-plt-got prints both MIPS GOT and PLT tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 18:23:10 +00:00
Simon Atanasyan
ba8d948e93 [yaml2obj] Initialize sh_addralign field for the .symtab section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241835 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 18:23:02 +00:00
David Majnemer
8343a0aa3b [llvm-readobj] Re-add sanity checking which was accidentally removed in r241764
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241831 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 18:14:31 +00:00
David Majnemer
f2c71ff7a8 [llvm-objdump] Require that jump targets shown in -d are functions
Don't let the disassembler pick call <.text> if a function happens to
live at the start of the section by only using function symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 18:11:40 +00:00
Justin Bogner
e1ef0c07e9 llvm-readobj: Fix an unused variable after r241764
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241783 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 04:27:36 +00:00
Adrian Prantl
2efb9f7c3e Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241781 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 02:14:49 +00:00
Michael J. Spencer
7d0e4c73d4 [Object][ELF] Support dumping hash-tables from files with no section table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241765 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 00:21:06 +00:00
David Majnemer
b1d6ad18ba [CodeView] Add support for emitting column information
Column information is present in CodeView when the line table subsection
has bit 0 set to 1 in it's flags field.  The column information is
represented as a pair of 16-bit quantities: a starting and ending
column.  This information is present at the end of the chunk, after all
the line-PC pairs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-09 00:19:51 +00:00