Commit Graph

15 Commits

Author SHA1 Message Date
Simon Atanasyan
dafce2c9a6 [ELFYAML] Group ELF section type flags to target specific blocks.
Recognize only flags which correspond to the current target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212880 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-12 18:25:08 +00:00
Simon Atanasyan
ce538c7834 [elf2yaml][ELF] Move Info field to the RelocationSection structure. This
field represents ELF section header sh_info field and does not have any
sense for regular sections. Its interpretation depends on section type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209801 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 11:05:31 +00:00
Simon Atanasyan
84a0dc323d [YAML] Add an optional argument EnumMask to the yaml::IO::bitSetCase().
Some bit-set fields used in ELF file headers in fact contain two parts.
The first one is a regular bit-field. The second one is an enumeraion.
For example ELF header `e_flags` for MIPS target might contain the
following values:

Bit-set values:

  EF_MIPS_NOREORDER = 0x00000001
  EF_MIPS_PIC       = 0x00000002
  EF_MIPS_CPIC      = 0x00000004
  EF_MIPS_ABI2      = 0x00000020

Enumeration:

  EF_MIPS_ARCH_32   = 0x50000000
  EF_MIPS_ARCH_64   = 0x60000000
  EF_MIPS_ARCH_32R2 = 0x70000000
  EF_MIPS_ARCH_64R2 = 0x80000000

For printing bit-sets we use the `yaml::IO::bitSetCase()`. It does not
support bit-set/enumeration combinations and prints too many flags from
an enumeration part. This patch fixes this problem. New method
`yaml::IO::maskedBitSetCase()` handle "enumeration" part of bitset
defined by provided mask.

Patch reviewed by Nick Kledzik and Sean Silva.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209504 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 08:07:09 +00:00
Simon Atanasyan
1564bf7dbe [obj2yaml][ELF] Print relocation's offset as a hex number. Use a proper
types to hold relocation's offset and addend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208906 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 18:04:09 +00:00
Simon Atanasyan
650c53fe2a [obj2yaml][ELF] Do not print empty Link and Info fields for ELF sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208905 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 18:04:02 +00:00
Simon Atanasyan
b8236e532a [obj2yaml] Support ELF input format in the obj2yaml tool.
The ELF header e_flags field in the MIPS related test cases handled
incorrectly. The obj2yaml prints too many flags. I will fix that in the
next patches.

The patch reviewed by Michael Spencer and Sean Silva.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208752 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-14 05:07:47 +00:00
David Majnemer
fb065a1669 Revert "Revert "YAMLIO: Encode ambiguous hex strings explicitly""
Don't quote octal compatible strings if they are only two wide, they
aren't ambiguous.

This reverts commit r205857 which reverted r205857.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205914 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 17:04:27 +00:00
David Majnemer
de6256c938 obj2yaml: Use the correct relocation type for different machine types
The IO normalizer would essentially lump I386 and AMD64 relocations
together.  Relocation types with the same numeric value would then get
mapped in appropriately.

For example:
IMAGE_REL_AMD64_ADDR64 and IMAGE_REL_I386_DIR16 both have a numeric
value of one.  We would see IMAGE_REL_I386_DIR16 in obj2yaml conversions
of object files with a machine type of IMAGE_FILE_MACHINE_AMD64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 23:12:20 +00:00
David Majnemer
6d191534f6 Object: Provide a richer means of describing auxiliary symbols
The current state of affairs has auxiliary symbols described as a big
bag of bytes. This is less than satisfying, it detracts from the YAML
file as being human readable.

Instead, allow for symbols to optionally contain their auxiliary data.
This allows us to have a much higher level way of describing things like
weak symbols, function definitions and section definitions.

This depends on D3105.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204214 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 04:47:47 +00:00
Rafael Espindola
e3a0e7f29d 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
2013-06-06 13:06:17 +00:00
Rafael Espindola
23a22cdedd 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
2013-06-05 03:20:13 +00:00
Rafael Espindola
e67c9c341f Use std::list so that we have a stable iterator.
I will try to avoid creating these std::strings, but for now this gets
the tests passing with libc++.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182405 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21 18:53:50 +00:00
Bob Wilson
ff9a6b44e0 Temporarily disable this test because it is failing when using libc++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182212 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-19 14:59:08 +00:00
Rafael Espindola
2bbe378147 Convert obj2yaml to use yamlio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182169 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 22:58:42 +00:00
Rafael Espindola
aa2163668d Add a test for obj2yaml in preparation for refactoring it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178829 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 02:02:05 +00:00