[ELFYAML] Support mips64 relocation record format in yaml2obj/obj2yaml

MIPS64 ELF file has a very specific relocation record format. Each
record might specify up to three relocation operations. So the `r_info`
field in fact consists of three relocation type sub-fields and optional
code of "special" symbols.

http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
page 40

The patch implements support of the MIPS64 relocation record format in
yaml2obj/obj2yaml tools by introducing new optional Relocation fields:
Type2, Type3, and SpecSym. These fields are recognized only if the
object/YAML file relates to the MIPS64 target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227044 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Atanasyan
2015-01-25 13:29:25 +00:00
parent 717d41d8c3
commit 09a46075ee
6 changed files with 219 additions and 19 deletions

View File

@@ -796,6 +796,14 @@ enum {
STN_UNDEF = 0
};
// Special relocation symbols used in the MIPS64 ELF relocation entries
enum {
RSS_UNDEF = 0, // None
RSS_GP = 1, // Value of gp
RSS_GP0 = 2, // Value of gp used to create object being relocated
RSS_LOC = 3 // Address of location being relocated
};
// Relocation entry, without explicit addend.
struct Elf32_Rel {
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)