Commit Graph

13 Commits

Author SHA1 Message Date
Zachary Turner 264b5d9e88 Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

Differential Revision: https://reviews.llvm.org/D33843

llvm-svn: 304864
2017-06-07 03:48:56 +00:00
Rui Ueyama 3a965f7e68 Change the error format to report corrupted .eh_frame.
llvm-svn: 299289
2017-04-01 01:42:20 +00:00
Rui Ueyama d57e74b7d3 Compute Config member function return values only once.
We had a few Config member functions that returns configuration values.
For example, we had is64() which returns true if the target is 64-bit.
The return values of these functions are constant and never change.

This patch is to compute them only once to make it clear that they'll
never change.

llvm-svn: 298168
2017-03-17 23:29:01 +00:00
Rui Ueyama fd06b73466 Define Config::isLE and Config::wordsize.
isLE() return true if the target is little-endian.
wordsize() returns 8 for 64-bit and 4 for 32-bit.

llvm-svn: 298167
2017-03-17 23:28:41 +00:00
Rafael Espindola b4c9b81aad Convert InputSectionBase to a class.
Removing this template is not a big win by itself, but opens the way
for removing more templates.

llvm-svn: 295923
2017-02-23 02:28:28 +00:00
Rui Ueyama a80915853a Add a comment about the copy relocation.
llvm-svn: 295622
2017-02-19 22:48:33 +00:00
Rui Ueyama da06bfb794 Move getLocation from Relocations.cpp to InputSection.cpp.
The function was used only within Relocations.cpp, but now we are
using it in many places, so this patch moves it to a file that fits
to the functionality.

llvm-svn: 287943
2016-11-25 18:51:53 +00:00
Eugene Leviant 531df4fcef [ELF] Print error location in .eh_frame parser
Differential revision: https://reviews.llvm.org/D26914

llvm-svn: 287750
2016-11-23 09:45:17 +00:00
Rui Ueyama 98bdbdaedd Split getFdeEncoding.
llvm-svn: 287452
2016-11-19 18:44:09 +00:00
Rui Ueyama a9b7514eb0 Fix typo in error message.
llvm-svn: 287451
2016-11-19 18:34:55 +00:00
Petr Hosek 14cd5c2405 [ELF] Allow arbitrary code alignment in .eh_frame
According to the specification, CIE code alignment factor is an
arbitrary unsigned LEB128 encoded value.

Differential revision: https://reviews.llvm.org/D22954

llvm-svn: 277105
2016-07-29 04:41:38 +00:00
Ed Maste 594e06b879 ELF: Handle empty CIE augmentation string
"A zero length string indicates that no augmentation data is present."

The FreeBSD/mips toolchain (GCC 4.2.1) generates .debug_frame sections
containing CIE records that have an empty augmentation string.

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

llvm-svn: 270706
2016-05-25 14:45:28 +00:00
Rui Ueyama f5febef249 Create a new file EhFrame.cpp and move code to read .eh_frame there.
llvm-svn: 270526
2016-05-24 02:55:45 +00:00