Re-enable target-specific relocation table sorting and use it for Mips
authorPetar Jovanovic <petar.jovanovic@imgtec.com>
Tue, 14 Apr 2015 13:23:34 +0000 (13:23 +0000)
committerPetar Jovanovic <petar.jovanovic@imgtec.com>
Tue, 14 Apr 2015 13:23:34 +0000 (13:23 +0000)
commit01b026b0231022e1f5607e103dc7720893478617
treeff8483a370000e14279d87c0fd488bfdbc7df44f
parent6c456f035108a53f3868d30e01941a62439d3052
Re-enable target-specific relocation table sorting and use it for Mips

Some targets (ie. Mips) have additional rules for ordering the relocation
table entries. Allow them to override generic sortRelocs(), which sorts
entries by Offset.
Then override this function for Mips, to emit HI16 and GOT16 relocations
against the local symbol in pair with the corresponding LO16 relocation.

Patch by Vladimir Stefanovic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234883 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCELFObjectWriter.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCELFObjectTargetWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
test/MC/Mips/sort-relocation-table.s [new file with mode: 0644]
test/MC/Mips/xgot.s