Reorganize the x86 ELF relocation selection logic.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 20 Mar 2015 19:48:54 +0000 (19:48 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 20 Mar 2015 19:48:54 +0000 (19:48 +0000)
commit82759c6cacf861a18b9d362ab6dc766573a1ce2d
tree1249cae53d4cdc347944fa93fba45024841932fc
parentc128839d6c9dc7abfe2531915454d7d6af225855
Reorganize the x86 ELF relocation selection logic.

The main differences are:

* Split in 32 and 64 bit functions.
* First switch on the Modifier so that we have only one non fully covered
  switch.
* Map the fixup kind first to a x86_64 (or i386) specific enum, to make
  it easy to handle cases like X86::reloc_riprel_4byte_movq_load.
* Switch on IsPCRel last, which reduces code duplication.

Fixes pr22308.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232837 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
test/MC/ELF/relocation-386.s
test/MC/ELF/relocation.s