[yaml2obj][ELF] ELF Relocations Support.
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 11 Apr 2014 04:13:39 +0000 (04:13 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 11 Apr 2014 04:13:39 +0000 (04:13 +0000)
commiteb0c9094acd5f5a28c0adafb1784797d1d7a4e2d
treed94849c02e0a4a546c075081bb4ace35f0ea2937
parent77cf856e56dc568ebe760e7de820323fdcf825a4
[yaml2obj][ELF] ELF Relocations Support.

The patch implements support for both relocation record formats: Elf_Rel
and Elf_Rela. It is possible to define relocation against symbol only.
Relocations against sections will be implemented later. Now yaml2obj
recognizes X86_64, MIPS and Hexagon relocation types.

Example of relocation section specification:
Sections:
- Name: .text
  Type: SHT_PROGBITS
  Content: "0000000000000000"
  AddressAlign: 16
  Flags: [SHF_ALLOC]

- Name: .rel.text
  Type: SHT_REL
  Info: .text
  AddressAlign: 4
  Relocations:
    - Offset: 0x1
      Symbol: glob1
      Type: R_MIPS_32
    - Offset: 0x2
      Symbol: glob2
      Type: R_MIPS_CALL16

The patch reviewed by Michael Spencer, Sean Silva, Shankar Easwaran.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206017 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/ELFYAML.h
lib/Object/ELFYAML.cpp
test/Object/yaml2obj-elf-rel.yaml [new file with mode: 0644]
tools/yaml2obj/yaml2elf.cpp