From 8ed205f0a35337089407a57cc8e01de59bc4e26b Mon Sep 17 00:00:00 2001 From: Nico Rieck Date: Fri, 12 Apr 2013 04:02:23 +0000 Subject: [PATCH] Add extensive relocation tests for llvm-readobj This test ensures that relocation type names returned by libObject match the raw relocation type value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179360 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../llvm-readobj/Inputs/relocs.obj.coff-i386 | Bin 0 -> 305 bytes .../Inputs/relocs.obj.coff-x86_64 | Bin 0 -> 424 bytes .../Inputs/relocs.obj.elf-aarch64 | Bin 0 -> 2832 bytes .../llvm-readobj/Inputs/relocs.obj.elf-arm | Bin 0 -> 2100 bytes .../llvm-readobj/Inputs/relocs.obj.elf-i386 | Bin 0 -> 1120 bytes .../llvm-readobj/Inputs/relocs.obj.elf-mips | Bin 0 -> 1132 bytes .../Inputs/relocs.obj.elf-mips64el | Bin 0 -> 2216 bytes .../llvm-readobj/Inputs/relocs.obj.elf-ppc64 | Bin 0 -> 3792 bytes .../llvm-readobj/Inputs/relocs.obj.elf-x86_64 | Bin 0 -> 1984 bytes .../llvm-readobj/Inputs/relocs.obj.macho-arm | Bin 0 -> 396 bytes .../llvm-readobj/Inputs/relocs.obj.macho-i386 | Bin 0 -> 368 bytes .../Inputs/relocs.obj.macho-x86_64 | Bin 0 -> 460 bytes test/tools/llvm-readobj/Inputs/relocs.py | 1086 +++++++++++++++++ test/tools/llvm-readobj/reloc-types.test | 663 ++++++++++ 14 files changed, 1749 insertions(+) create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.coff-i386 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.coff-x86_64 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-aarch64 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-arm create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-i386 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-mips create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-mips64el create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-ppc64 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.elf-x86_64 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.macho-arm create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.macho-i386 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.obj.macho-x86_64 create mode 100644 test/tools/llvm-readobj/Inputs/relocs.py create mode 100644 test/tools/llvm-readobj/reloc-types.test diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.coff-i386 b/test/tools/llvm-readobj/Inputs/relocs.obj.coff-i386 new file mode 100644 index 0000000000000000000000000000000000000000..15e43ef54fef26a57d1dc2e432650e9af385fe09 GIT binary patch literal 305 zcmeZaWMufHn;!U`fq{V;h(SQFB(DG z$T$WrD2tIn5Xxd=kbtt-804WWb_O*li<3bY%Hm=$fwH(6tf4F(1}7+sm%$Ut5<&4I eBT$r?5#&jb$3Ori!oZN0pAV*C1QP=bkO=@|Y#uBC literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.coff-x86_64 b/test/tools/llvm-readobj/Inputs/relocs.obj.coff-x86_64 new file mode 100644 index 0000000000000000000000000000000000000000..cd63173b0e3a668b91c49a4a7be36dbc7c5efca3 GIT binary patch literal 424 zcmc)GD-Oay6ouh`+VU>11c^W(fgq4bB!&cuKon{SH5CYCLrA(UR>TUJ3x|XqaFaXt zn-PH}3KU{Lz#@+YQ_ro^6`o2fZ_i0&_w*U8x{2Ky$2(jcCNC87B zWGqEYqzVhE`u?HaQe&mFI%}!HR%)`7S|n1;Nor%c*)1KeQkO#N@tdpHK literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.elf-aarch64 b/test/tools/llvm-readobj/Inputs/relocs.obj.elf-aarch64 new file mode 100644 index 0000000000000000000000000000000000000000..d39e60c8eec31b435d1b7ecf48a98fb7b2958a43 GIT binary patch literal 2832 zcmeIzEo@U!7{>A2b{}Qywsz~bvUa1e0)>vtfF+a!Q2_)oF@ZoJ=+Y$kVsLpZ@>;aS!~Bm9@Gbth55pUv4%%zq#5BHiG(c zSaap(`fj^X59)h&{ou8}aH>5rE2B|UqZE0bMm=&@SU1i3s=^&D?Dk1&VoqfxENzX1 z+OB9|U+3H_6?WK~2c4hkGS~KU`=7H$BzUaZurD6zch$BIv@PflOZy6V{rS*%cAHYx zg$`IF65K!1wXfP4*L`%N>z8Zi=ynow-u2G=lHRwY8l{#$?=?5q*%uzguHS`Q(Nap( z-TjHf?KxW{;O-1P@N8$e*9&*=T_3!l@%`|kJP9w!55ddw0r;GJ5I!$Y!58F1@Tzc^YB%90lp@mhToCT zzyo;&-jZL0-<4P4Tk^p$NkrfC`|=e0fqV%5P(BRbmXE+6$sye>D}j9C`NiS_-13FR0=y`{1pfARj2#xkt(YQu54h*t^ZDL;zwdj0@4owcXSOzP zi^XD5p~a$P^mY_Q{Zn!)#kDz-Q6egi{(1A}+57(f48k3VQUl$+sciRPHcEA7GEpki zlgSQb)19J%Lw&h%S2~+6T(fstEF;{*srk%s|4RP5i@BM2em>+(&&PoZ3*~zFTv!Wv z34K|9T*S~CCe#Y!LcN*dkpHf{(g``jT)mnQ1oXvWEzy_AGksq>&AF-Jq zvxQ}BR`NU-^8%OfB0u9LR`D{I za+II*3cuhOlf23=d5z0>onLXB)x5#4d6OyL;&R?*4exLT@A4bo<4WFVEgx_dA96Jx zaSb1{j!(FjPq~iIxt=dr&zIc5SKP?g+{AEw8W`thCipE&xP_%`WEr=zoZDEz?^wwu zR`Gi#`2(x@BWu{qT5e|@cd(v6v4JgYrJ&vs_HhlAY9VgAVxcJMsYyueOgioSYdpZ~JjikO z@&@~OlZSYVhk2X*yu%~B%K_eFhWDA}10Ll=9^)e(=VK1?35WQUC-|Hv`GUiI$y0pA T(|pY{41ZiBjPooLJjZ_ldVYEc literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.elf-i386 b/test/tools/llvm-readobj/Inputs/relocs.obj.elf-i386 new file mode 100644 index 0000000000000000000000000000000000000000..7860df6de7630922930e34c75c457b5960e12123 GIT binary patch literal 1120 zcmd_oKP&@L9Ki8++GQ`kzlgST0ra&77O7oY-G30gB|9t97xQ z^}CJ*zmBCQtYe{#ueQjdJSX?0F2s!M+ySVX)6e8T`TZ}Ie%_9f`}tG9hV1L@E4gyYC1o#U zvUACdolU1#QmgiAaxRmy^?T4j&d0(!timYzP~O3hy%@k@ti}lp;uMB(2E#auH8_v8 zxP*1MjP^iY_+e9=6~Cw&D@C;R&|mDaP;&JMaQK@e;f63cK+d nd+-K(@fQ2=4*T&Q2k-$0@ezmc2}kf5NAU&6@D=0uhU54NobO^C literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.elf-mips b/test/tools/llvm-readobj/Inputs/relocs.obj.elf-mips new file mode 100644 index 0000000000000000000000000000000000000000..e387942b450bd512af14273c138304c491174319 GIT binary patch literal 1132 zcmdtgtusVX7{~E*uj^g#{{C*U-mdi$1VO+Ef*=TjHOvURGiL7%%or;Of*=TjAP9mW z2!bF8f*|{Ae1F$HmJxJk=IrNr_CDvFyU*GD!t$cyIz`3~$CME|HYJ>n;?K_{Pm5<= zWB$`Ler`MChueFh@i&9O_`yyP=EC$Qk##>CD zFiV*_Q&W4jG7JAD<35wC2X@%~Z2n6Y|EMAVwqKO!tgjj!YJ&Z2VIw`(`*^CM2cF)$ z3bhaAo(k$w@70XzaXad_bffx~K;1_YD{vIm(-g9o;T}C5J%cqki?uk1bvTclVV1A~ zm$4C7unAX@v&|Z|;5w>z8`y?h$UB)G?7$3m;x2Y!h~2n{J$Qh+qa*CYV@%))_TwoI z;293$Ir7`g1rFgQ>c4e`BY2IYc!Ohji$31rINoClA8-O6aT1?!3ZL;1Uoela`2GQ} C_(5a< literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.elf-mips64el b/test/tools/llvm-readobj/Inputs/relocs.obj.elf-mips64el new file mode 100644 index 0000000000000000000000000000000000000000..a9779645c3125dbbb389123cb0e49abedcb314b4 GIT binary patch literal 2216 zcmdtisgD#v6bIm%`xJBE_kH$U2n1pTkP#~o2n2%J>?SLAlg&5C{YUfj}S- z2m}IwK&(KlK%htQr%WXpN)zxp$-PS2NydAc@*alBdyV|BJNugvAKY;nH6Q1!{uT*4OpQ`0L)(-u?4 znCs#fqHMcuHI20!b-C4V_P4&s^Z51njLvkT?5cavkvJc(!Z^uUujHPLL z{s|Qj_GQ)OH78u>=0Y!Mt-&WVt=<0od1>~w(~ujDbkZ^G^W!yp+ja04Me`k+k=(w! z`*#zu-6QaSWK5|fEx<1za; n^vT5f{C-EDPN&@e27NZ0vHw8dY&Pt-=-cg<{U`cvw`2bUn(9zL literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.elf-ppc64 b/test/tools/llvm-readobj/Inputs/relocs.obj.elf-ppc64 new file mode 100644 index 0000000000000000000000000000000000000000..c46e4c04285beae4209358ef825b623de60b5a46 GIT binary patch literal 3792 zcmeH|zfTlV5XWcX#6t*Cqe6(9QxlY^CkKLuBAzi4;txWMF~o{P*qjPTxGm5^DJhAC z@lPNY#y^2r7)wiHVf+)&!r1A2cV~`aRxFIhhDmnk&F6jJzPE3`yZh|wjiI`_pq?}W z+Rx2E%gwodDXvR$ZldhK3{mkO(a0j@Vk)O?o@~Uw-Uqwq+wK3b1Nr%>>2f}rT8Jng zO;oFtk54guG&f24YNZ;@N974_X?{Et*OTR_{1;c;z}M3E7Hu1)qzD!*;1|2gFIf>wZ-_<{p);KSt}oQ zJzx?|{{DAJhmObnH}fHN#?4<}61~5^t&gzAjgwJS8-H1ey`tc=28SrFw{WS^mU#^3p-7l-x=TT#5uwL)e z@xM7>*i&+-dlFOcQ>3g9mmW3x?;6zSr=g;r)h>8h+96is5@UICUAm&+uWx zTMZvKyxs5x!w(t0Y{RI{jSW#d}p;xZ23GV^kXCL@3f_vY!3-|syEZqC0Te$aE zpK!cmHm-4jc`=WT5iYU4Zfy;Wr&W zDqP=3)#EwgI=2KUKQH{Y5pjZE^kJJa)ZyR_X(6f93H^rL6%YP-#EOOeT+AyRdM1{4T@!QnT(9Wm^7hTIj}9vB-JF-hl)sjc4S=ITElZq@ zh&VS;J>9R+tqpw(#4>M&pC`z$eLa|rbM}a=$A$3mwoy@So2RrzFHaKKTi^WXH*Ba zZLFiWh8y?jz+_jQOfunQGwJkZYAd^yNII!(b+F8g*dL$O5@9UFm5%d4!5&NZ?+@Zh zAH!f<@Fmh`D_S+_^K{%#=}UB+oAhNm&QW@j-lTk;j_;G>H|WjEx9Paoa{LaxRe6El zrhK2?uH2>LOlACII`&)oDZNwq8NEyS1-)DOCA~-a6&-g;=Dnu(DZioP{N?yt`hfB~ z`k?ZAI{q&i=Yc+~{E+L@t1_lOBAZ7$&W*~k7#2^6T*MM1=ga$|mr~pK>LorA_2*k&iq*jzb*bsh* zYeWcw4`RXegV{ihTp$JuLj#Bc0VW`p0OAUu9LU@jAi)8oxq&zUh_L~XI#R*E|NmeA z1>!$I{2PdW0r5{D{sF|_f%qE`e+6O{h{3!H5L#9SLhFLu2n4nw5ZYG&LdSx_6bN!b ZZU%x{76{!7p%~_Z+zNMZab+$@8~_MRII92v literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.macho-i386 b/test/tools/llvm-readobj/Inputs/relocs.obj.macho-i386 new file mode 100644 index 0000000000000000000000000000000000000000..5305fe8663a2a686d64dab6a2522b3a25aa4f1c5 GIT binary patch literal 368 zcma)&Jqp4=5QWEoK@gjOSV$U=;1SYWM6e4Af(J-pVc`iqgb1e4!p1_u^?i(sjfDg6 zeQzdAcG<(@`s$cjL#lmv5-s(9NB&V`W?F#kBlfAHDA(K4v-f$n$iF=)?vqn3wh2w! z1F9|!rJ25wH)2=pF_S3fh>G;?f3Kb)gzApnunTs^jxw{6ex;*Zi8C2EC)`8xDfbpL Q3C>|3Q}L!T+tOCd-kvWjT>t<8 literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.obj.macho-x86_64 b/test/tools/llvm-readobj/Inputs/relocs.obj.macho-x86_64 new file mode 100644 index 0000000000000000000000000000000000000000..42b80dd9d2f01afa6ec859ea4bc3549ece74327c GIT binary patch literal 460 zcmX^A>+L^w1_nlE1|R{%AR5e205KRCB!PGan1!7%f(k2uGy?&Q4>XejgrUL=@$n_8 z6(t}Q5D*_9;u;YG;~{96ewcY7Km)iy(ku)O2vrOWOhAqV5HA7BgV;xaGzXC82I2r9 z1_6*b2!jBOhVY0dUx1X7L@+SuL5%0sgwV1o5L#CrLfc9~XkSqX9V-B#b3twgf?75R a-3tx7xgeSk$^l7%;s}|~kjRh(5(fYPc^d}+ literal 0 HcmV?d00001 diff --git a/test/tools/llvm-readobj/Inputs/relocs.py b/test/tools/llvm-readobj/Inputs/relocs.py new file mode 100644 index 00000000000..232d080d7d7 --- /dev/null +++ b/test/tools/llvm-readobj/Inputs/relocs.py @@ -0,0 +1,1086 @@ +#!/usr/bin/env python + +# Generates ELF, COFF and MachO object files for different architectures +# containing all relocations: +# +# ELF: i386, x86_64, ppc64, aarch64, arm, mips, mips64el +# COFF: i386, x86_64 +# MachO: i386, x86_64, arm +# (see end of file for triples) +# +# To simplify generation, object files are generated with just the proper +# number of relocations through repeated instructions. Afterwards, the +# relocations in the object file are patched to their proper value. + +import operator +import shutil +import StringIO +import struct +import subprocess +import sys + +class EnumType(type): + def __init__(self, name, bases = (), attributes = {}): + super(EnumType, self).__init__(name, bases, attributes) + + type.__setattr__(self, '_map', {}) + type.__setattr__(self, '_nameMap', {}) + + for symbol in attributes: + if symbol.startswith('__') or symbol.endswith('__'): + continue + + value = attributes[symbol] + + # MyEnum.symbol == value + type.__setattr__(self, symbol, value) + self._nameMap[symbol] = value + + # The first symbol with the given value is authoritative. + if not (value in self._map): + # MyEnum[value] == symbol + self._map[value] = symbol + + # Not supported (Enums are immutable). + def __setattr__(self, name, value): + raise NotSupportedException, self.__setattr__ + + # Not supported (Enums are immutable). + def __delattr__(self, name): + raise NotSupportedException, self.__delattr__ + + # Gets the enum symbol for the specified value. + def __getitem__(self, value): + symbol = self._map.get(value) + if symbol is None: + raise KeyError, value + return symbol + + # Gets the enum symbol for the specified value or none. + def lookup(self, value): + symbol = self._map.get(value) + return symbol + + # Not supported (Enums are immutable). + def __setitem__(self, value, symbol): + raise NotSupportedException, self.__setitem__ + + # Not supported (Enums are immutable). + def __delitem__(self, value): + raise NotSupportedException, self.__delitem__ + + def entries(self): + # sort by (value, name) + def makeKey(item): + return (item[1], item[0]) + e = [] + for pair in sorted(self._nameMap.iteritems(), key=makeKey): + e.append(pair) + return e + + def __iter__(self): + for e in self.entries(): + yield e + +Enum = EnumType('Enum', (), {}) + +class BinaryReader: + def __init__(self, path): + self.file = open(path, "r+b", 0) + self.isLSB = None + self.is64Bit = None + self.isN64 = False + + def tell(self): + return self.file.tell() + + def seek(self, pos): + self.file.seek(pos) + + def read(self, N): + data = self.file.read(N) + if len(data) != N: + raise ValueError, "Out of data!" + return data + + def int8(self): + return ord(self.read(1)) + + def uint8(self): + return ord(self.read(1)) + + def int16(self): + return struct.unpack('><'[self.isLSB] + 'h', self.read(2))[0] + + def uint16(self): + return struct.unpack('><'[self.isLSB] + 'H', self.read(2))[0] + + def int32(self): + return struct.unpack('><'[self.isLSB] + 'i', self.read(4))[0] + + def uint32(self): + return struct.unpack('><'[self.isLSB] + 'I', self.read(4))[0] + + def int64(self): + return struct.unpack('><'[self.isLSB] + 'q', self.read(8))[0] + + def uint64(self): + return struct.unpack('><'[self.isLSB] + 'Q', self.read(8))[0] + + def writeUInt8(self, value): + self.file.write(struct.pack('><'[self.isLSB] + 'B', value)) + + def writeUInt16(self, value): + self.file.write(struct.pack('><'[self.isLSB] + 'H', value)) + + def writeUInt32(self, value): + self.file.write(struct.pack('><'[self.isLSB] + 'I', value)) + + def writeUInt64(self, value): + self.file.write(struct.pack('><'[self.isLSB] + 'Q', value)) + + def word(self): + if self.is64Bit: + return self.uint64() + else: + return self.uint32() + + def writeWord(self, value): + if self.is64Bit: + self.writeUInt64(value) + else: + self.writeUInt32(value) + +class StringTable: + def __init__(self, strings): + self.string_table = strings + + def __getitem__(self, index): + end = self.string_table.index('\x00', index) + return self.string_table[index:end] + +class ElfSection: + def __init__(self, f): + self.sh_name = f.uint32() + self.sh_type = f.uint32() + self.sh_flags = f.word() + self.sh_addr = f.word() + self.sh_offset = f.word() + self.sh_size = f.word() + self.sh_link = f.uint32() + self.sh_info = f.uint32() + self.sh_addralign = f.word() + self.sh_entsize = f.word() + + def patch(self, f, relocs): + if self.sh_type == 4 or self.sh_type == 9: # SHT_RELA / SHT_REL + self.patchRelocs(f, relocs) + + def patchRelocs(self, f, relocs): + entries = self.sh_size // self.sh_entsize + + for index in range(entries): + f.seek(self.sh_offset + index * self.sh_entsize) + r_offset = f.word() + + if index < len(relocs): + ri = index + else: + ri = 0 + + if f.isN64: + r_sym = f.uint32() + r_ssym = f.uint8() + f.seek(f.tell()) + f.writeUInt8(relocs[ri][1]) + f.writeUInt8(relocs[ri][1]) + f.writeUInt8(relocs[ri][1]) + else: + pos = f.tell() + r_info = f.word() + + r_type = relocs[ri][1] + if f.is64Bit: + r_info = (r_info & 0xFFFFFFFF00000000) | (r_type & 0xFFFFFFFF) + else: + r_info = (r_info & 0xFF00) | (r_type & 0xFF) + + print(" %s" % relocs[ri][0]) + f.seek(pos) + f.writeWord(r_info) + + +class CoffSection: + def __init__(self, f): + self.raw_name = f.read(8) + self.virtual_size = f.uint32() + self.virtual_address = f.uint32() + self.raw_data_size = f.uint32() + self.pointer_to_raw_data = f.uint32() + self.pointer_to_relocations = f.uint32() + self.pointer_to_line_numbers = f.uint32() + self.relocation_count = f.uint16() + self.line_number_count = f.uint16() + self.characteristics = f.uint32() + + +def compileAsm(filename, triple, src): + cmd = ["llvm-mc", "-triple=" + triple, "-filetype=obj", "-o", filename] + print(" Running: " + " ".join(cmd)) + p = subprocess.Popen(cmd, stdin=subprocess.PIPE) + p.communicate(input=src) + p.wait() + +def compileIR(filename, triple, src): + cmd = ["llc", "-mtriple=" + triple, "-filetype=obj", "-o", filename] + print(" Running: " + " ".join(cmd)) + p = subprocess.Popen(cmd, stdin=subprocess.PIPE) + p.communicate(input=src) + p.wait() + + +def craftElf(filename, triple, relocs, dummyReloc): + print("Crafting " + filename + " for " + triple) + if type(dummyReloc) is tuple: + preSrc, dummyReloc, relocsPerDummy = dummyReloc + src = preSrc + "\n" + for i in range((len(relocs) + relocsPerDummy - 1) / relocsPerDummy): + src += dummyReloc.format(i) + "\n" + compileIR(filename, triple, src) + else: + src = (dummyReloc + "\n") * len(relocs) + compileAsm(filename, triple, src) + + print(" Patching relocations...") + patchElf(filename, relocs) + +def patchElf(path, relocs): + f = BinaryReader(path) + + magic = f.read(4) + assert magic == '\x7FELF' + + fileclass = f.uint8() + if fileclass == 1: + f.is64Bit = False + elif fileclass == 2: + f.is64Bit = True + else: + raise ValueError, "Unknown file class %x" % fileclass + + byteordering = f.uint8() + if byteordering == 1: + f.isLSB = True + elif byteordering == 2: + f.isLSB = False + else: + raise ValueError, "Unknown byte ordering %x" % byteordering + + f.seek(18) + e_machine = f.uint16() + if e_machine == 0x0008 and f.is64Bit: # EM_MIPS && 64 bit + f.isN64 = True + + e_version = f.uint32() + e_entry = f.word() + e_phoff = f.word() + e_shoff = f.word() + e_flags = f.uint32() + e_ehsize = f.uint16() + e_phentsize = f.uint16() + e_phnum = f.uint16() + e_shentsize = f.uint16() + e_shnum = f.uint16() + e_shstrndx = f.uint16() + + sections = [] + for index in range(e_shnum): + f.seek(e_shoff + index * e_shentsize) + s = ElfSection(f) + sections.append(s) + + f.seek(sections[e_shstrndx].sh_offset) + shstrtab = StringTable(f.read(sections[e_shstrndx].sh_size)) + + strtab = None + for section in sections: + if shstrtab[section.sh_name] == ".strtab": + f.seek(section.sh_offset) + strtab = StringTable(f.read(section.sh_size)) + break + + for index in range(e_shnum): + sections[index].patch(f, relocs) + + +def craftCoff(filename, triple, relocs, dummyReloc): + print("Crafting " + filename + " for " + triple) + src = (dummyReloc + "\n") * len(relocs) + compileAsm(filename, triple, src) + + print(" Patching relocations...") + patchCoff(filename, relocs) + +def patchCoff(path, relocs): + f = BinaryReader(path) + f.isLSB = True + + machine_type = f.uint16() + section_count = f.uint16() + f.seek(20) + sections = [CoffSection(f) for idx in range(section_count)] + + section = sections[0] + f.seek(section.pointer_to_relocations) + for i in range(section.relocation_count): + virtual_addr = f.uint32() + symtab_idx = f.uint32() + print(" %s" % relocs[i][0]) + f.writeUInt16(relocs[i][1]) + + +def craftMacho(filename, triple, relocs, dummyReloc): + print("Crafting " + filename + " for " + triple) + + if type(dummyReloc) is tuple: + srcType, preSrc, dummyReloc, relocsPerDummy = dummyReloc + src = preSrc + "\n" + for i in range((len(relocs) + relocsPerDummy - 1) / relocsPerDummy): + src += dummyReloc.format(i) + "\n" + if srcType == "asm": + compileAsm(filename, triple, src) + elif srcType == "ir": + compileIR(filename, triple, src) + else: + src = (dummyReloc + "\n") * len(relocs) + compileAsm(filename, triple, src) + + print(" Patching relocations...") + patchMacho(filename, relocs) + +def patchMacho(filename, relocs): + f = BinaryReader(filename) + + magic = f.read(4) + if magic == '\xFE\xED\xFA\xCE': + f.isLSB, f.is64Bit = False, False + elif magic == '\xCE\xFA\xED\xFE': + f.isLSB, f.is64Bit = True, False + elif magic == '\xFE\xED\xFA\xCF': + f.isLSB, f.is64Bit = False, True + elif magic == '\xCF\xFA\xED\xFE': + f.isLSB, f.is64Bit = True, True + else: + raise ValueError,"Not a Mach-O object file: %r (bad magic)" % path + + cputype = f.uint32() + cpusubtype = f.uint32() + filetype = f.uint32() + numLoadCommands = f.uint32() + loadCommandsSize = f.uint32() + flag = f.uint32() + if f.is64Bit: + reserved = f.uint32() + + start = f.tell() + + for i in range(numLoadCommands): + patchMachoLoadCommand(f, relocs) + + if f.tell() - start != loadCommandsSize: + raise ValueError,"%s: warning: invalid load commands size: %r" % ( + sys.argv[0], loadCommandsSize) + +def patchMachoLoadCommand(f, relocs): + start = f.tell() + cmd = f.uint32() + cmdSize = f.uint32() + + if cmd == 1: + patchMachoSegmentLoadCommand(f, relocs) + elif cmd == 25: + patchMachoSegmentLoadCommand(f, relocs) + else: + f.read(cmdSize - 8) + + if f.tell() - start != cmdSize: + raise ValueError,"%s: warning: invalid load command size: %r" % ( + sys.argv[0], cmdSize) + +def patchMachoSegmentLoadCommand(f, relocs): + segment_name = f.read(16) + vm_addr = f.word() + vm_size = f.word() + file_offset = f.word() + file_size = f.word() + maxprot = f.uint32() + initprot = f.uint32() + numSections = f.uint32() + flags = f.uint32() + for i in range(numSections): + patchMachoSection(f, relocs) + +def patchMachoSection(f, relocs): + section_name = f.read(16) + segment_name = f.read(16) + address = f.word() + size = f.word() + offset = f.uint32() + alignment = f.uint32() + relocOffset = f.uint32() + numReloc = f.uint32() + flags = f.uint32() + reserved1 = f.uint32() + reserved2 = f.uint32() + if f.is64Bit: + reserved3 = f.uint32() + + prev_pos = f.tell() + + f.seek(relocOffset) + for i in range(numReloc): + ri = i < len(relocs) and i or 0 + print(" %s" % relocs[ri][0]) + word1 = f.uint32() + pos = f.tell() + value = f.uint32() + f.seek(pos) + value = (value & 0x0FFFFFFF) | ((relocs[ri][1] & 0xF) << 28) + f.writeUInt32(value) + f.seek(prev_pos) + + +class Relocs_Elf_X86_64(Enum): + R_X86_64_NONE = 0 + R_X86_64_64 = 1 + R_X86_64_PC32 = 2 + R_X86_64_GOT32 = 3 + R_X86_64_PLT32 = 4 + R_X86_64_COPY = 5 + R_X86_64_GLOB_DAT = 6 + R_X86_64_JUMP_SLOT = 7 + R_X86_64_RELATIVE = 8 + R_X86_64_GOTPCREL = 9 + R_X86_64_32 = 10 + R_X86_64_32S = 11 + R_X86_64_16 = 12 + R_X86_64_PC16 = 13 + R_X86_64_8 = 14 + R_X86_64_PC8 = 15 + R_X86_64_DTPMOD64 = 16 + R_X86_64_DTPOFF64 = 17 + R_X86_64_TPOFF64 = 18 + R_X86_64_TLSGD = 19 + R_X86_64_TLSLD = 20 + R_X86_64_DTPOFF32 = 21 + R_X86_64_GOTTPOFF = 22 + R_X86_64_TPOFF32 = 23 + R_X86_64_PC64 = 24 + R_X86_64_GOTOFF64 = 25 + R_X86_64_GOTPC32 = 26 + R_X86_64_GOT64 = 27 + R_X86_64_GOTPCREL64 = 28 + R_X86_64_GOTPC64 = 29 + R_X86_64_GOTPLT64 = 30 + R_X86_64_PLTOFF64 = 31 + R_X86_64_SIZE32 = 32 + R_X86_64_SIZE64 = 33 + R_X86_64_GOTPC32_TLSDESC = 34 + R_X86_64_TLSDESC_CALL = 35 + R_X86_64_TLSDESC = 36 + R_X86_64_IRELATIVE = 37 + +class Relocs_Elf_i386(Enum): + R_386_NONE = 0 + R_386_32 = 1 + R_386_PC32 = 2 + R_386_GOT32 = 3 + R_386_PLT32 = 4 + R_386_COPY = 5 + R_386_GLOB_DAT = 6 + R_386_JUMP_SLOT = 7 + R_386_RELATIVE = 8 + R_386_GOTOFF = 9 + R_386_GOTPC = 10 + R_386_32PLT = 11 + R_386_TLS_TPOFF = 14 + R_386_TLS_IE = 15 + R_386_TLS_GOTIE = 16 + R_386_TLS_LE = 17 + R_386_TLS_GD = 18 + R_386_TLS_LDM = 19 + R_386_16 = 20 + R_386_PC16 = 21 + R_386_8 = 22 + R_386_PC8 = 23 + R_386_TLS_GD_32 = 24 + R_386_TLS_GD_PUSH = 25 + R_386_TLS_GD_CALL = 26 + R_386_TLS_GD_POP = 27 + R_386_TLS_LDM_32 = 28 + R_386_TLS_LDM_PUSH = 29 + R_386_TLS_LDM_CALL = 30 + R_386_TLS_LDM_POP = 31 + R_386_TLS_LDO_32 = 32 + R_386_TLS_IE_32 = 33 + R_386_TLS_LE_32 = 34 + R_386_TLS_DTPMOD32 = 35 + R_386_TLS_DTPOFF32 = 36 + R_386_TLS_TPOFF32 = 37 + R_386_TLS_GOTDESC = 39 + R_386_TLS_DESC_CALL = 40 + R_386_TLS_DESC = 41 + R_386_IRELATIVE = 42 + R_386_NUM = 43 + +class Relocs_Elf_MBlaze(Enum): + R_MICROBLAZE_NONE = 0 + R_MICROBLAZE_32 = 1 + R_MICROBLAZE_32_PCREL = 2 + R_MICROBLAZE_64_PCREL = 3 + R_MICROBLAZE_32_PCREL_LO = 4 + R_MICROBLAZE_64 = 5 + R_MICROBLAZE_32_LO = 6 + R_MICROBLAZE_SRO32 = 7 + R_MICROBLAZE_SRW32 = 8 + R_MICROBLAZE_64_NONE = 9 + R_MICROBLAZE_32_SYM_OP_SYM = 10 + R_MICROBLAZE_GNU_VTINHERIT = 11 + R_MICROBLAZE_GNU_VTENTRY = 12 + R_MICROBLAZE_GOTPC_64 = 13 + R_MICROBLAZE_GOT_64 = 14 + R_MICROBLAZE_PLT_64 = 15 + R_MICROBLAZE_REL = 16 + R_MICROBLAZE_JUMP_SLOT = 17 + R_MICROBLAZE_GLOB_DAT = 18 + R_MICROBLAZE_GOTOFF_64 = 19 + R_MICROBLAZE_GOTOFF_32 = 20 + R_MICROBLAZE_COPY = 21 + +class Relocs_Elf_PPC32(Enum): + R_PPC_NONE = 0 + R_PPC_ADDR32 = 1 + R_PPC_ADDR24 = 2 + R_PPC_ADDR16 = 3 + R_PPC_ADDR16_LO = 4 + R_PPC_ADDR16_HI = 5 + R_PPC_ADDR16_HA = 6 + R_PPC_ADDR14 = 7 + R_PPC_ADDR14_BRTAKEN = 8 + R_PPC_ADDR14_BRNTAKEN = 9 + R_PPC_REL24 = 10 + R_PPC_REL14 = 11 + R_PPC_REL14_BRTAKEN = 12 + R_PPC_REL14_BRNTAKEN = 13 + R_PPC_REL32 = 26 + R_PPC_TPREL16_LO = 70 + R_PPC_TPREL16_HA = 72 + +class Relocs_Elf_PPC64(Enum): + R_PPC64_NONE = 0 + R_PPC64_ADDR32 = 1 + R_PPC64_ADDR16_LO = 4 + R_PPC64_ADDR16_HI = 5 + R_PPC64_ADDR14 = 7 + R_PPC64_REL24 = 10 + R_PPC64_REL32 = 26 + R_PPC64_ADDR64 = 38 + R_PPC64_ADDR16_HIGHER = 39 + R_PPC64_ADDR16_HIGHEST = 41 + R_PPC64_REL64 = 44 + R_PPC64_TOC16 = 47 + R_PPC64_TOC16_LO = 48 + R_PPC64_TOC16_HA = 50 + R_PPC64_TOC = 51 + R_PPC64_ADDR16_DS = 56 + R_PPC64_ADDR16_LO_DS = 57 + R_PPC64_TOC16_DS = 63 + R_PPC64_TOC16_LO_DS = 64 + R_PPC64_TLS = 67 + R_PPC64_TPREL16_LO = 70 + R_PPC64_TPREL16_HA = 72 + R_PPC64_DTPREL16_LO = 75 + R_PPC64_DTPREL16_HA = 77 + R_PPC64_GOT_TLSGD16_LO = 80 + R_PPC64_GOT_TLSGD16_HA = 82 + R_PPC64_GOT_TLSLD16_LO = 84 + R_PPC64_GOT_TLSLD16_HA = 86 + R_PPC64_GOT_TPREL16_LO_DS = 88 + R_PPC64_GOT_TPREL16_HA = 90 + R_PPC64_TLSGD = 107 + R_PPC64_TLSLD = 108 + +class Relocs_Elf_AArch64(Enum): + R_AARCH64_NONE = 0x100 + R_AARCH64_ABS64 = 0x101 + R_AARCH64_ABS32 = 0x102 + R_AARCH64_ABS16 = 0x103 + R_AARCH64_PREL64 = 0x104 + R_AARCH64_PREL32 = 0x105 + R_AARCH64_PREL16 = 0x106 + R_AARCH64_MOVW_UABS_G0 = 0x107 + R_AARCH64_MOVW_UABS_G0_NC = 0x108 + R_AARCH64_MOVW_UABS_G1 = 0x109 + R_AARCH64_MOVW_UABS_G1_NC = 0x10a + R_AARCH64_MOVW_UABS_G2 = 0x10b + R_AARCH64_MOVW_UABS_G2_NC = 0x10c + R_AARCH64_MOVW_UABS_G3 = 0x10d + R_AARCH64_MOVW_SABS_G0 = 0x10e + R_AARCH64_MOVW_SABS_G1 = 0x10f + R_AARCH64_MOVW_SABS_G2 = 0x110 + R_AARCH64_LD_PREL_LO19 = 0x111 + R_AARCH64_ADR_PREL_LO21 = 0x112 + R_AARCH64_ADR_PREL_PG_HI21 = 0x113 + R_AARCH64_ADD_ABS_LO12_NC = 0x115 + R_AARCH64_LDST8_ABS_LO12_NC = 0x116 + R_AARCH64_TSTBR14 = 0x117 + R_AARCH64_CONDBR19 = 0x118 + R_AARCH64_JUMP26 = 0x11a + R_AARCH64_CALL26 = 0x11b + R_AARCH64_LDST16_ABS_LO12_NC = 0x11c + R_AARCH64_LDST32_ABS_LO12_NC = 0x11d + R_AARCH64_LDST64_ABS_LO12_NC = 0x11e + R_AARCH64_LDST128_ABS_LO12_NC = 0x12b + R_AARCH64_ADR_GOT_PAGE = 0x137 + R_AARCH64_LD64_GOT_LO12_NC = 0x138 + R_AARCH64_TLSLD_MOVW_DTPREL_G2 = 0x20b + R_AARCH64_TLSLD_MOVW_DTPREL_G1 = 0x20c + R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC = 0x20d + R_AARCH64_TLSLD_MOVW_DTPREL_G0 = 0x20e + R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC = 0x20f + R_AARCH64_TLSLD_ADD_DTPREL_HI12 = 0x210 + R_AARCH64_TLSLD_ADD_DTPREL_LO12 = 0x211 + R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC = 0x212 + R_AARCH64_TLSLD_LDST8_DTPREL_LO12 = 0x213 + R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC = 0x214 + R_AARCH64_TLSLD_LDST16_DTPREL_LO12 = 0x215 + R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC = 0x216 + R_AARCH64_TLSLD_LDST32_DTPREL_LO12 = 0x217 + R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC = 0x218 + R_AARCH64_TLSLD_LDST64_DTPREL_LO12 = 0x219 + R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC = 0x21a + R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 = 0x21b + R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC = 0x21c + R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 = 0x21d + R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 0x21e + R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 = 0x21f + R_AARCH64_TLSLE_MOVW_TPREL_G2 = 0x220 + R_AARCH64_TLSLE_MOVW_TPREL_G1 = 0x221 + R_AARCH64_TLSLE_MOVW_TPREL_G1_NC = 0x222 + R_AARCH64_TLSLE_MOVW_TPREL_G0 = 0x223 + R_AARCH64_TLSLE_MOVW_TPREL_G0_NC = 0x224 + R_AARCH64_TLSLE_ADD_TPREL_HI12 = 0x225 + R_AARCH64_TLSLE_ADD_TPREL_LO12 = 0x226 + R_AARCH64_TLSLE_ADD_TPREL_LO12_NC = 0x227 + R_AARCH64_TLSLE_LDST8_TPREL_LO12 = 0x228 + R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC = 0x229 + R_AARCH64_TLSLE_LDST16_TPREL_LO12 = 0x22a + R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC = 0x22b + R_AARCH64_TLSLE_LDST32_TPREL_LO12 = 0x22c + R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC = 0x22d + R_AARCH64_TLSLE_LDST64_TPREL_LO12 = 0x22e + R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC = 0x22f + R_AARCH64_TLSDESC_ADR_PAGE = 0x232 + R_AARCH64_TLSDESC_LD64_LO12_NC = 0x233 + R_AARCH64_TLSDESC_ADD_LO12_NC = 0x234 + R_AARCH64_TLSDESC_CALL = 0x239 + +class Relocs_Elf_ARM(Enum): + R_ARM_NONE = 0x00 + R_ARM_PC24 = 0x01 + R_ARM_ABS32 = 0x02 + R_ARM_REL32 = 0x03 + R_ARM_LDR_PC_G0 = 0x04 + R_ARM_ABS16 = 0x05 + R_ARM_ABS12 = 0x06 + R_ARM_THM_ABS5 = 0x07 + R_ARM_ABS8 = 0x08 + R_ARM_SBREL32 = 0x09 + R_ARM_THM_CALL = 0x0a + R_ARM_THM_PC8 = 0x0b + R_ARM_BREL_ADJ = 0x0c + R_ARM_TLS_DESC = 0x0d + R_ARM_THM_SWI8 = 0x0e + R_ARM_XPC25 = 0x0f + R_ARM_THM_XPC22 = 0x10 + R_ARM_TLS_DTPMOD32 = 0x11 + R_ARM_TLS_DTPOFF32 = 0x12 + R_ARM_TLS_TPOFF32 = 0x13 + R_ARM_COPY = 0x14 + R_ARM_GLOB_DAT = 0x15 + R_ARM_JUMP_SLOT = 0x16 + R_ARM_RELATIVE = 0x17 + R_ARM_GOTOFF32 = 0x18 + R_ARM_BASE_PREL = 0x19 + R_ARM_GOT_BREL = 0x1a + R_ARM_PLT32 = 0x1b + R_ARM_CALL = 0x1c + R_ARM_JUMP24 = 0x1d + R_ARM_THM_JUMP24 = 0x1e + R_ARM_BASE_ABS = 0x1f + R_ARM_ALU_PCREL_7_0 = 0x20 + R_ARM_ALU_PCREL_15_8 = 0x21 + R_ARM_ALU_PCREL_23_15 = 0x22 + R_ARM_LDR_SBREL_11_0_NC = 0x23 + R_ARM_ALU_SBREL_19_12_NC = 0x24 + R_ARM_ALU_SBREL_27_20_CK = 0x25 + R_ARM_TARGET1 = 0x26 + R_ARM_SBREL31 = 0x27 + R_ARM_V4BX = 0x28 + R_ARM_TARGET2 = 0x29 + R_ARM_PREL31 = 0x2a + R_ARM_MOVW_ABS_NC = 0x2b + R_ARM_MOVT_ABS = 0x2c + R_ARM_MOVW_PREL_NC = 0x2d + R_ARM_MOVT_PREL = 0x2e + R_ARM_THM_MOVW_ABS_NC = 0x2f + R_ARM_THM_MOVT_ABS = 0x30 + R_ARM_THM_MOVW_PREL_NC = 0x31 + R_ARM_THM_MOVT_PREL = 0x32 + R_ARM_THM_JUMP19 = 0x33 + R_ARM_THM_JUMP6 = 0x34 + R_ARM_THM_ALU_PREL_11_0 = 0x35 + R_ARM_THM_PC12 = 0x36 + R_ARM_ABS32_NOI = 0x37 + R_ARM_REL32_NOI = 0x38 + R_ARM_ALU_PC_G0_NC = 0x39 + R_ARM_ALU_PC_G0 = 0x3a + R_ARM_ALU_PC_G1_NC = 0x3b + R_ARM_ALU_PC_G1 = 0x3c + R_ARM_ALU_PC_G2 = 0x3d + R_ARM_LDR_PC_G1 = 0x3e + R_ARM_LDR_PC_G2 = 0x3f + R_ARM_LDRS_PC_G0 = 0x40 + R_ARM_LDRS_PC_G1 = 0x41 + R_ARM_LDRS_PC_G2 = 0x42 + R_ARM_LDC_PC_G0 = 0x43 + R_ARM_LDC_PC_G1 = 0x44 + R_ARM_LDC_PC_G2 = 0x45 + R_ARM_ALU_SB_G0_NC = 0x46 + R_ARM_ALU_SB_G0 = 0x47 + R_ARM_ALU_SB_G1_NC = 0x48 + R_ARM_ALU_SB_G1 = 0x49 + R_ARM_ALU_SB_G2 = 0x4a + R_ARM_LDR_SB_G0 = 0x4b + R_ARM_LDR_SB_G1 = 0x4c + R_ARM_LDR_SB_G2 = 0x4d + R_ARM_LDRS_SB_G0 = 0x4e + R_ARM_LDRS_SB_G1 = 0x4f + R_ARM_LDRS_SB_G2 = 0x50 + R_ARM_LDC_SB_G0 = 0x51 + R_ARM_LDC_SB_G1 = 0x52 + R_ARM_LDC_SB_G2 = 0x53 + R_ARM_MOVW_BREL_NC = 0x54 + R_ARM_MOVT_BREL = 0x55 + R_ARM_MOVW_BREL = 0x56 + R_ARM_THM_MOVW_BREL_NC = 0x57 + R_ARM_THM_MOVT_BREL = 0x58 + R_ARM_THM_MOVW_BREL = 0x59 + R_ARM_TLS_GOTDESC = 0x5a + R_ARM_TLS_CALL = 0x5b + R_ARM_TLS_DESCSEQ = 0x5c + R_ARM_THM_TLS_CALL = 0x5d + R_ARM_PLT32_ABS = 0x5e + R_ARM_GOT_ABS = 0x5f + R_ARM_GOT_PREL = 0x60 + R_ARM_GOT_BREL12 = 0x61 + R_ARM_GOTOFF12 = 0x62 + R_ARM_GOTRELAX = 0x63 + R_ARM_GNU_VTENTRY = 0x64 + R_ARM_GNU_VTINHERIT = 0x65 + R_ARM_THM_JUMP11 = 0x66 + R_ARM_THM_JUMP8 = 0x67 + R_ARM_TLS_GD32 = 0x68 + R_ARM_TLS_LDM32 = 0x69 + R_ARM_TLS_LDO32 = 0x6a + R_ARM_TLS_IE32 = 0x6b + R_ARM_TLS_LE32 = 0x6c + R_ARM_TLS_LDO12 = 0x6d + R_ARM_TLS_LE12 = 0x6e + R_ARM_TLS_IE12GP = 0x6f + R_ARM_PRIVATE_0 = 0x70 + R_ARM_PRIVATE_1 = 0x71 + R_ARM_PRIVATE_2 = 0x72 + R_ARM_PRIVATE_3 = 0x73 + R_ARM_PRIVATE_4 = 0x74 + R_ARM_PRIVATE_5 = 0x75 + R_ARM_PRIVATE_6 = 0x76 + R_ARM_PRIVATE_7 = 0x77 + R_ARM_PRIVATE_8 = 0x78 + R_ARM_PRIVATE_9 = 0x79 + R_ARM_PRIVATE_10 = 0x7a + R_ARM_PRIVATE_11 = 0x7b + R_ARM_PRIVATE_12 = 0x7c + R_ARM_PRIVATE_13 = 0x7d + R_ARM_PRIVATE_14 = 0x7e + R_ARM_PRIVATE_15 = 0x7f + R_ARM_ME_TOO = 0x80 + R_ARM_THM_TLS_DESCSEQ16 = 0x81 + R_ARM_THM_TLS_DESCSEQ32 = 0x82 + +class Relocs_Elf_Mips(Enum): + R_MIPS_NONE = 0 + R_MIPS_16 = 1 + R_MIPS_32 = 2 + R_MIPS_REL32 = 3 + R_MIPS_26 = 4 + R_MIPS_HI16 = 5 + R_MIPS_LO16 = 6 + R_MIPS_GPREL16 = 7 + R_MIPS_LITERAL = 8 + R_MIPS_GOT16 = 9 + R_MIPS_PC16 = 10 + R_MIPS_CALL16 = 11 + R_MIPS_GPREL32 = 12 + R_MIPS_SHIFT5 = 16 + R_MIPS_SHIFT6 = 17 + R_MIPS_64 = 18 + R_MIPS_GOT_DISP = 19 + R_MIPS_GOT_PAGE = 20 + R_MIPS_GOT_OFST = 21 + R_MIPS_GOT_HI16 = 22 + R_MIPS_GOT_LO16 = 23 + R_MIPS_SUB = 24 + R_MIPS_INSERT_A = 25 + R_MIPS_INSERT_B = 26 + R_MIPS_DELETE = 27 + R_MIPS_HIGHER = 28 + R_MIPS_HIGHEST = 29 + R_MIPS_CALL_HI16 = 30 + R_MIPS_CALL_LO16 = 31 + R_MIPS_SCN_DISP = 32 + R_MIPS_REL16 = 33 + R_MIPS_ADD_IMMEDIATE = 34 + R_MIPS_PJUMP = 35 + R_MIPS_RELGOT = 36 + R_MIPS_JALR = 37 + R_MIPS_TLS_DTPMOD32 = 38 + R_MIPS_TLS_DTPREL32 = 39 + R_MIPS_TLS_DTPMOD64 = 40 + R_MIPS_TLS_DTPREL64 = 41 + R_MIPS_TLS_GD = 42 + R_MIPS_TLS_LDM = 43 + R_MIPS_TLS_DTPREL_HI16 = 44 + R_MIPS_TLS_DTPREL_LO16 = 45 + R_MIPS_TLS_GOTTPREL = 46 + R_MIPS_TLS_TPREL32 = 47 + R_MIPS_TLS_TPREL64 = 48 + R_MIPS_TLS_TPREL_HI16 = 49 + R_MIPS_TLS_TPREL_LO16 = 50 + R_MIPS_GLOB_DAT = 51 + R_MIPS_COPY = 126 + R_MIPS_JUMP_SLOT = 127 + R_MIPS_NUM = 218 + +class Relocs_Elf_Hexagon(Enum): + R_HEX_NONE = 0 + R_HEX_B22_PCREL = 1 + R_HEX_B15_PCREL = 2 + R_HEX_B7_PCREL = 3 + R_HEX_LO16 = 4 + R_HEX_HI16 = 5 + R_HEX_32 = 6 + R_HEX_16 = 7 + R_HEX_8 = 8 + R_HEX_GPREL16_0 = 9 + R_HEX_GPREL16_1 = 10 + R_HEX_GPREL16_2 = 11 + R_HEX_GPREL16_3 = 12 + R_HEX_HL16 = 13 + R_HEX_B13_PCREL = 14 + R_HEX_B9_PCREL = 15 + R_HEX_B32_PCREL_X = 16 + R_HEX_32_6_X = 17 + R_HEX_B22_PCREL_X = 18 + R_HEX_B15_PCREL_X = 19 + R_HEX_B13_PCREL_X = 20 + R_HEX_B9_PCREL_X = 21 + R_HEX_B7_PCREL_X = 22 + R_HEX_16_X = 23 + R_HEX_12_X = 24 + R_HEX_11_X = 25 + R_HEX_10_X = 26 + R_HEX_9_X = 27 + R_HEX_8_X = 28 + R_HEX_7_X = 29 + R_HEX_6_X = 30 + R_HEX_32_PCREL = 31 + R_HEX_COPY = 32 + R_HEX_GLOB_DAT = 33 + R_HEX_JMP_SLOT = 34 + R_HEX_RELATIVE = 35 + R_HEX_PLT_B22_PCREL = 36 + R_HEX_GOTREL_LO16 = 37 + R_HEX_GOTREL_HI16 = 38 + R_HEX_GOTREL_32 = 39 + R_HEX_GOT_LO16 = 40 + R_HEX_GOT_HI16 = 41 + R_HEX_GOT_32 = 42 + R_HEX_GOT_16 = 43 + R_HEX_DTPMOD_32 = 44 + R_HEX_DTPREL_LO16 = 45 + R_HEX_DTPREL_HI16 = 46 + R_HEX_DTPREL_32 = 47 + R_HEX_DTPREL_16 = 48 + R_HEX_GD_PLT_B22_PCREL = 49 + R_HEX_GD_GOT_LO16 = 50 + R_HEX_GD_GOT_HI16 = 51 + R_HEX_GD_GOT_32 = 52 + R_HEX_GD_GOT_16 = 53 + R_HEX_IE_LO16 = 54 + R_HEX_IE_HI16 = 55 + R_HEX_IE_32 = 56 + R_HEX_IE_GOT_LO16 = 57 + R_HEX_IE_GOT_HI16 = 58 + R_HEX_IE_GOT_32 = 59 + R_HEX_IE_GOT_16 = 60 + R_HEX_TPREL_LO16 = 61 + R_HEX_TPREL_HI16 = 62 + R_HEX_TPREL_32 = 63 + R_HEX_TPREL_16 = 64 + R_HEX_6_PCREL_X = 65 + R_HEX_GOTREL_32_6_X = 66 + R_HEX_GOTREL_16_X = 67 + R_HEX_GOTREL_11_X = 68 + R_HEX_GOT_32_6_X = 69 + R_HEX_GOT_16_X = 70 + R_HEX_GOT_11_X = 71 + R_HEX_DTPREL_32_6_X = 72 + R_HEX_DTPREL_16_X = 73 + R_HEX_DTPREL_11_X = 74 + R_HEX_GD_GOT_32_6_X = 75 + R_HEX_GD_GOT_16_X = 76 + R_HEX_GD_GOT_11_X = 77 + R_HEX_IE_32_6_X = 78 + R_HEX_IE_16_X = 79 + R_HEX_IE_GOT_32_6_X = 80 + R_HEX_IE_GOT_16_X = 81 + R_HEX_IE_GOT_11_X = 82 + R_HEX_TPREL_32_6_X = 83 + R_HEX_TPREL_16_X = 84 + R_HEX_TPREL_11_X = 85 + + +class Relocs_Coff_i386(Enum): + IMAGE_REL_I386_ABSOLUTE = 0x0000 + IMAGE_REL_I386_DIR16 = 0x0001 + IMAGE_REL_I386_REL16 = 0x0002 + IMAGE_REL_I386_DIR32 = 0x0006 + IMAGE_REL_I386_DIR32NB = 0x0007 + IMAGE_REL_I386_SEG12 = 0x0009 + IMAGE_REL_I386_SECTION = 0x000A + IMAGE_REL_I386_SECREL = 0x000B + IMAGE_REL_I386_TOKEN = 0x000C + IMAGE_REL_I386_SECREL7 = 0x000D + IMAGE_REL_I386_REL32 = 0x0014 + +class Relocs_Coff_X86_64(Enum): + IMAGE_REL_AMD64_ABSOLUTE = 0x0000 + IMAGE_REL_AMD64_ADDR64 = 0x0001 + IMAGE_REL_AMD64_ADDR32 = 0x0002 + IMAGE_REL_AMD64_ADDR32NB = 0x0003 + IMAGE_REL_AMD64_REL32 = 0x0004 + IMAGE_REL_AMD64_REL32_1 = 0x0005 + IMAGE_REL_AMD64_REL32_2 = 0x0006 + IMAGE_REL_AMD64_REL32_3 = 0x0007 + IMAGE_REL_AMD64_REL32_4 = 0x0008 + IMAGE_REL_AMD64_REL32_5 = 0x0009 + IMAGE_REL_AMD64_SECTION = 0x000A + IMAGE_REL_AMD64_SECREL = 0x000B + IMAGE_REL_AMD64_SECREL7 = 0x000C + IMAGE_REL_AMD64_TOKEN = 0x000D + IMAGE_REL_AMD64_SREL32 = 0x000E + IMAGE_REL_AMD64_PAIR = 0x000F + IMAGE_REL_AMD64_SSPAN32 = 0x0010 + +class Relocs_Coff_ARM(Enum): + IMAGE_REL_ARM_ABSOLUTE = 0x0000 + IMAGE_REL_ARM_ADDR32 = 0x0001 + IMAGE_REL_ARM_ADDR32NB = 0x0002 + IMAGE_REL_ARM_BRANCH24 = 0x0003 + IMAGE_REL_ARM_BRANCH11 = 0x0004 + IMAGE_REL_ARM_TOKEN = 0x0005 + IMAGE_REL_ARM_BLX24 = 0x0008 + IMAGE_REL_ARM_BLX11 = 0x0009 + IMAGE_REL_ARM_SECTION = 0x000E + IMAGE_REL_ARM_SECREL = 0x000F + IMAGE_REL_ARM_MOV32A = 0x0010 + IMAGE_REL_ARM_MOV32T = 0x0011 + IMAGE_REL_ARM_BRANCH20T = 0x0012 + IMAGE_REL_ARM_BRANCH24T = 0x0014 + IMAGE_REL_ARM_BLX23T = 0x0015 + + +class Relocs_Macho_i386(Enum): + RIT_Vanilla = 0 + RIT_Pair = 1 + RIT_Difference = 2 + RIT_Generic_PreboundLazyPointer = 3 + RIT_Generic_LocalDifference = 4 + RIT_Generic_TLV = 5 + +class Relocs_Macho_X86_64(Enum): + RIT_X86_64_Unsigned = 0 + RIT_X86_64_Signed = 1 + RIT_X86_64_Branch = 2 + RIT_X86_64_GOTLoad = 3 + RIT_X86_64_GOT = 4 + RIT_X86_64_Subtractor = 5 + RIT_X86_64_Signed1 = 6 + RIT_X86_64_Signed2 = 7 + RIT_X86_64_Signed4 = 8 + RIT_X86_64_TLV = 9 + +class Relocs_Macho_ARM(Enum): + RIT_Vanilla = 0 + RIT_Pair = 1 + RIT_Difference = 2 + RIT_ARM_LocalDifference = 3 + RIT_ARM_PreboundLazyPointer = 4 + RIT_ARM_Branch24Bit = 5 + RIT_ARM_ThumbBranch22Bit = 6 + RIT_ARM_ThumbBranch32Bit = 7 + RIT_ARM_Half = 8 + RIT_ARM_HalfDifference = 9 + +class Relocs_Macho_PPC(Enum): + PPC_RELOC_VANILLA = 0 + PPC_RELOC_PAIR = 1 + PPC_RELOC_BR14 = 2 + PPC_RELOC_BR24 = 3 + PPC_RELOC_HI16 = 4 + PPC_RELOC_LO16 = 5 + PPC_RELOC_HA16 = 6 + PPC_RELOC_LO14 = 7 + PPC_RELOC_SECTDIFF = 8 + PPC_RELOC_PB_LA_PTR = 9 + PPC_RELOC_HI16_SECTDIFF = 10 + PPC_RELOC_LO16_SECTDIFF = 11 + PPC_RELOC_HA16_SECTDIFF = 12 + PPC_RELOC_JBSR = 13 + PPC_RELOC_LO14_SECTDIFF = 14 + PPC_RELOC_LOCAL_SECTDIFF = 15 + + +craftElf("relocs.obj.elf-x86_64", "x86_64-pc-linux-gnu", Relocs_Elf_X86_64.entries(), "leaq sym@GOTTPOFF(%rip), %rax") +craftElf("relocs.obj.elf-i386", "i386-pc-linux-gnu", Relocs_Elf_i386.entries(), "mov sym@GOTOFF(%ebx), %eax") +#craftElf("relocs-elf-ppc32", "powerpc-unknown-linux-gnu", Relocs_Elf_PPC32.entries(), ...) +craftElf("relocs.obj.elf-ppc64", "powerpc64-unknown-linux-gnu", Relocs_Elf_PPC64.entries(), + ("@t = thread_local global i32 0, align 4", "define i32* @f{0}() nounwind {{ ret i32* @t }}", 2)) +craftElf("relocs.obj.elf-aarch64", "aarch64", Relocs_Elf_AArch64.entries(), "movz x0, #:abs_g0:sym") +craftElf("relocs.obj.elf-arm", "arm-unknown-unknown", Relocs_Elf_ARM.entries(), "b sym") +craftElf("relocs.obj.elf-mips", "mips-unknown-linux", Relocs_Elf_Mips.entries(), "lui $2, %hi(sym)") +craftElf("relocs.obj.elf-mips64el", "mips64el-unknown-linux", Relocs_Elf_Mips.entries(), "lui $2, %hi(sym)") +#craftElf("relocs.obj.elf-mblaze", "mblaze-unknown-unknown", Relocs_Elf_MBlaze.entries(), ...) +#craftElf("relocs.obj.elf-hexagon", "hexagon-unknown-unknown", Relocs_Elf_Hexagon.entries(), ...) + +craftCoff("relocs.obj.coff-i386", "i386-pc-win32", Relocs_Coff_i386.entries(), "mov foo@imgrel(%ebx, %ecx, 4), %eax") +craftCoff("relocs.obj.coff-x86_64", "x86_64-pc-win32", Relocs_Coff_X86_64.entries(), "mov foo@imgrel(%ebx, %ecx, 4), %eax") +#craftCoff("relocs.obj.coff-arm", "arm-pc-win32", Relocs_Coff_ARM.entries(), "...") + +craftMacho("relocs.obj.macho-i386", "i386-apple-darwin9", Relocs_Macho_i386.entries(), + ("asm", ".subsections_via_symbols; .text; a: ; b:", "call a", 1)) +craftMacho("relocs.obj.macho-x86_64", "x86_64-apple-darwin9", Relocs_Macho_X86_64.entries(), + ("asm", ".subsections_via_symbols; .text; a: ; b:", "call a", 1)) +craftMacho("relocs.obj.macho-arm", "armv7-apple-darwin10", Relocs_Macho_ARM.entries(), "bl sym") +#craftMacho("relocs.obj.macho-ppc", "powerpc-apple-darwin10", Relocs_Macho_PPC.entries(), ...) diff --git a/test/tools/llvm-readobj/reloc-types.test b/test/tools/llvm-readobj/reloc-types.test new file mode 100644 index 00000000000..08603bc7fb5 --- /dev/null +++ b/test/tools/llvm-readobj/reloc-types.test @@ -0,0 +1,663 @@ +// Test that libObject and subsequently llvm-readobj shows proper relocation type +// names and values. + +// Todo: ELF-PPC, ELF-HEXAGON + +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-i386 | FileCheck %s -check-prefix ELF-32 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-x86_64 | FileCheck %s -check-prefix ELF-64 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-aarch64 | FileCheck %s -check-prefix ELF-AARCH64 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-arm | FileCheck %s -check-prefix ELF-ARM +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-mips | FileCheck %s -check-prefix ELF-MIPS +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-mips64el | FileCheck %s -check-prefix ELF-MIPS64EL +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.elf-ppc64 | FileCheck %s -check-prefix ELF-PPC64 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.coff-i386 | FileCheck %s -check-prefix COFF-32 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.coff-x86_64 | FileCheck %s -check-prefix COFF-64 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.macho-arm | FileCheck %s -check-prefix MACHO-ARM +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.macho-i386 | FileCheck %s -check-prefix MACHO-32 +RUN: llvm-readobj -r -expand-relocs %p/Inputs/relocs.obj.macho-x86_64 | FileCheck %s -check-prefix MACHO-64 + + +ELF-32: Type: R_386_NONE (0) +ELF-32: Type: R_386_32 (1) +ELF-32: Type: R_386_PC32 (2) +ELF-32: Type: R_386_GOT32 (3) +ELF-32: Type: R_386_PLT32 (4) +ELF-32: Type: R_386_COPY (5) +ELF-32: Type: R_386_GLOB_DAT (6) +ELF-32: Type: R_386_JUMP_SLOT (7) +ELF-32: Type: R_386_RELATIVE (8) +ELF-32: Type: R_386_GOTOFF (9) +ELF-32: Type: R_386_GOTPC (10) +ELF-32: Type: R_386_32PLT (11) +ELF-32: Type: R_386_TLS_TPOFF (14) +ELF-32: Type: R_386_TLS_IE (15) +ELF-32: Type: R_386_TLS_GOTIE (16) +ELF-32: Type: R_386_TLS_LE (17) +ELF-32: Type: R_386_TLS_GD (18) +ELF-32: Type: R_386_TLS_LDM (19) +ELF-32: Type: R_386_16 (20) +ELF-32: Type: R_386_PC16 (21) +ELF-32: Type: R_386_8 (22) +ELF-32: Type: R_386_PC8 (23) +ELF-32: Type: R_386_TLS_GD_32 (24) +ELF-32: Type: R_386_TLS_GD_PUSH (25) +ELF-32: Type: R_386_TLS_GD_CALL (26) +ELF-32: Type: R_386_TLS_GD_POP (27) +ELF-32: Type: R_386_TLS_LDM_32 (28) +ELF-32: Type: R_386_TLS_LDM_PUSH (29) +ELF-32: Type: R_386_TLS_LDM_CALL (30) +ELF-32: Type: R_386_TLS_LDM_POP (31) +ELF-32: Type: R_386_TLS_LDO_32 (32) +ELF-32: Type: R_386_TLS_IE_32 (33) +ELF-32: Type: R_386_TLS_LE_32 (34) +ELF-32: Type: R_386_TLS_DTPMOD32 (35) +ELF-32: Type: R_386_TLS_DTPOFF32 (36) +ELF-32: Type: R_386_TLS_TPOFF32 (37) +ELF-32: Type: R_386_TLS_GOTDESC (39) +ELF-32: Type: R_386_TLS_DESC_CALL (40) +ELF-32: Type: R_386_TLS_DESC (41) +ELF-32: Type: R_386_IRELATIVE (42) +_LF-32: Type: R_386_NUM (43) + +ELF-64: Type: R_X86_64_NONE (0) +ELF-64: Type: R_X86_64_64 (1) +ELF-64: Type: R_X86_64_PC32 (2) +ELF-64: Type: R_X86_64_GOT32 (3) +ELF-64: Type: R_X86_64_PLT32 (4) +ELF-64: Type: R_X86_64_COPY (5) +ELF-64: Type: R_X86_64_GLOB_DAT (6) +ELF-64: Type: R_X86_64_JUMP_SLOT (7) +ELF-64: Type: R_X86_64_RELATIVE (8) +ELF-64: Type: R_X86_64_GOTPCREL (9) +ELF-64: Type: R_X86_64_32 (10) +ELF-64: Type: R_X86_64_32S (11) +ELF-64: Type: R_X86_64_16 (12) +ELF-64: Type: R_X86_64_PC16 (13) +ELF-64: Type: R_X86_64_8 (14) +ELF-64: Type: R_X86_64_PC8 (15) +ELF-64: Type: R_X86_64_DTPMOD64 (16) +ELF-64: Type: R_X86_64_DTPOFF64 (17) +ELF-64: Type: R_X86_64_TPOFF64 (18) +ELF-64: Type: R_X86_64_TLSGD (19) +ELF-64: Type: R_X86_64_TLSLD (20) +ELF-64: Type: R_X86_64_DTPOFF32 (21) +ELF-64: Type: R_X86_64_GOTTPOFF (22) +ELF-64: Type: R_X86_64_TPOFF32 (23) +ELF-64: Type: R_X86_64_PC64 (24) +ELF-64: Type: R_X86_64_GOTOFF64 (25) +ELF-64: Type: R_X86_64_GOTPC32 (26) +ELF-64: Type: R_X86_64_GOT64 (27) +ELF-64: Type: R_X86_64_GOTPCREL64 (28) +ELF-64: Type: R_X86_64_GOTPC64 (29) +ELF-64: Type: R_X86_64_GOTPLT64 (30) +ELF-64: Type: R_X86_64_PLTOFF64 (31) +ELF-64: Type: R_X86_64_SIZE32 (32) +ELF-64: Type: R_X86_64_SIZE64 (33) +ELF-64: Type: R_X86_64_GOTPC32_TLSDESC (34) +ELF-64: Type: R_X86_64_TLSDESC_CALL (35) +ELF-64: Type: R_X86_64_TLSDESC (36) +ELF-64: Type: R_X86_64_IRELATIVE (37) + +ELF-PPC: Type: R_PPC_NONE (0) +ELF-PPC: Type: R_PPC_ADDR32 (1) +ELF-PPC: Type: R_PPC_ADDR24 (2) +ELF-PPC: Type: R_PPC_ADDR16 (3) +ELF-PPC: Type: R_PPC_ADDR16_LO (4) +ELF-PPC: Type: R_PPC_ADDR16_HI (5) +ELF-PPC: Type: R_PPC_ADDR16_HA (6) +ELF-PPC: Type: R_PPC_ADDR14 (7) +ELF-PPC: Type: R_PPC_ADDR14_BRTAKEN (8) +ELF-PPC: Type: R_PPC_ADDR14_BRNTAKEN (9) +ELF-PPC: Type: R_PPC_REL24 (10) +ELF-PPC: Type: R_PPC_REL14 (11) +ELF-PPC: Type: R_PPC_REL14_BRTAKEN (12) +ELF-PPC: Type: R_PPC_REL14_BRNTAKEN (13) +ELF-PPC: Type: R_PPC_REL32 (26) +ELF-PPC: Type: R_PPC_TPREL16_LO (70) +ELF-PPC: Type: R_PPC_TPREL16_HA (72) + +ELF-PPC64: Type: R_PPC64_NONE (0) +ELF-PPC64: Type: R_PPC64_ADDR32 (1) +ELF-PPC64: Type: R_PPC64_ADDR16_LO (4) +ELF-PPC64: Type: R_PPC64_ADDR16_HI (5) +ELF-PPC64: Type: R_PPC64_ADDR14 (7) +ELF-PPC64: Type: R_PPC64_REL24 (10) +ELF-PPC64: Type: R_PPC64_REL32 (26) +ELF-PPC64: Type: R_PPC64_ADDR64 (38) +ELF-PPC64: Type: R_PPC64_ADDR16_HIGHER (39) +ELF-PPC64: Type: R_PPC64_ADDR16_HIGHEST (41) +ELF-PPC64: Type: R_PPC64_REL64 (44) +ELF-PPC64: Type: R_PPC64_TOC16 (47) +ELF-PPC64: Type: R_PPC64_TOC16_LO (48) +ELF-PPC64: Type: R_PPC64_TOC16_HA (50) +ELF-PPC64: Type: R_PPC64_TOC (51) +ELF-PPC64: Type: R_PPC64_ADDR16_DS (56) +ELF-PPC64: Type: R_PPC64_ADDR16_LO_DS (57) +ELF-PPC64: Type: R_PPC64_TOC16_DS (63) +ELF-PPC64: Type: R_PPC64_TOC16_LO_DS (64) +ELF-PPC64: Type: R_PPC64_TLS (67) +ELF-PPC64: Type: R_PPC64_TPREL16_LO (70) +ELF-PPC64: Type: R_PPC64_TPREL16_HA (72) +ELF-PPC64: Type: R_PPC64_DTPREL16_LO (75) +ELF-PPC64: Type: R_PPC64_DTPREL16_HA (77) +ELF-PPC64: Type: R_PPC64_GOT_TLSGD16_LO (80) +ELF-PPC64: Type: R_PPC64_GOT_TLSGD16_HA (82) +ELF-PPC64: Type: R_PPC64_GOT_TLSLD16_LO (84) +ELF-PPC64: Type: R_PPC64_GOT_TLSLD16_HA (86) +ELF-PPC64: Type: R_PPC64_GOT_TPREL16_LO_DS (88) +ELF-PPC64: Type: R_PPC64_GOT_TPREL16_HA (90) +ELF-PPC64: Type: R_PPC64_TLSGD (107) +ELF-PPC64: Type: R_PPC64_TLSLD (108) + +ELF-AARCH64: Type: R_AARCH64_NONE (256) +ELF-AARCH64: Type: R_AARCH64_ABS64 (257) +ELF-AARCH64: Type: R_AARCH64_ABS32 (258) +ELF-AARCH64: Type: R_AARCH64_ABS16 (259) +ELF-AARCH64: Type: R_AARCH64_PREL64 (260) +ELF-AARCH64: Type: R_AARCH64_PREL32 (261) +ELF-AARCH64: Type: R_AARCH64_PREL16 (262) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G0 (263) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G0_NC (264) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G1 (265) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G1_NC (266) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G2 (267) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G2_NC (268) +ELF-AARCH64: Type: R_AARCH64_MOVW_UABS_G3 (269) +ELF-AARCH64: Type: R_AARCH64_MOVW_SABS_G0 (270) +ELF-AARCH64: Type: R_AARCH64_MOVW_SABS_G1 (271) +ELF-AARCH64: Type: R_AARCH64_MOVW_SABS_G2 (272) +ELF-AARCH64: Type: R_AARCH64_LD_PREL_LO19 (273) +ELF-AARCH64: Type: R_AARCH64_ADR_PREL_LO21 (274) +ELF-AARCH64: Type: R_AARCH64_ADR_PREL_PG_HI21 (275) +ELF-AARCH64: Type: R_AARCH64_ADD_ABS_LO12_NC (277) +ELF-AARCH64: Type: R_AARCH64_LDST8_ABS_LO12_NC (278) +ELF-AARCH64: Type: R_AARCH64_TSTBR14 (279) +ELF-AARCH64: Type: R_AARCH64_CONDBR19 (280) +ELF-AARCH64: Type: R_AARCH64_JUMP26 (282) +ELF-AARCH64: Type: R_AARCH64_CALL26 (283) +ELF-AARCH64: Type: R_AARCH64_LDST16_ABS_LO12_NC (284) +ELF-AARCH64: Type: R_AARCH64_LDST32_ABS_LO12_NC (285) +ELF-AARCH64: Type: R_AARCH64_LDST64_ABS_LO12_NC (286) +ELF-AARCH64: Type: R_AARCH64_LDST128_ABS_LO12_NC (299) +ELF-AARCH64: Type: R_AARCH64_ADR_GOT_PAGE (311) +ELF-AARCH64: Type: R_AARCH64_LD64_GOT_LO12_NC (312) +ELF-AARCH64: Type: R_AARCH64_TLSLD_MOVW_DTPREL_G2 (523) +ELF-AARCH64: Type: R_AARCH64_TLSLD_MOVW_DTPREL_G1 (524) +ELF-AARCH64: Type: R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC (525) +ELF-AARCH64: Type: R_AARCH64_TLSLD_MOVW_DTPREL_G0 (526) +ELF-AARCH64: Type: R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC (527) +ELF-AARCH64: Type: R_AARCH64_TLSLD_ADD_DTPREL_HI12 (528) +ELF-AARCH64: Type: R_AARCH64_TLSLD_ADD_DTPREL_LO12 (529) +ELF-AARCH64: Type: R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC (530) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST8_DTPREL_LO12 (531) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC (532) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST16_DTPREL_LO12 (533) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC (534) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST32_DTPREL_LO12 (535) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC (536) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST64_DTPREL_LO12 (537) +ELF-AARCH64: Type: R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC (538) +ELF-AARCH64: Type: R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 (539) +ELF-AARCH64: Type: R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC (540) +ELF-AARCH64: Type: R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 (541) +ELF-AARCH64: Type: R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC (542) +ELF-AARCH64: Type: R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 (543) +ELF-AARCH64: Type: R_AARCH64_TLSLE_MOVW_TPREL_G2 (544) +ELF-AARCH64: Type: R_AARCH64_TLSLE_MOVW_TPREL_G1 (545) +ELF-AARCH64: Type: R_AARCH64_TLSLE_MOVW_TPREL_G1_NC (546) +ELF-AARCH64: Type: R_AARCH64_TLSLE_MOVW_TPREL_G0 (547) +ELF-AARCH64: Type: R_AARCH64_TLSLE_MOVW_TPREL_G0_NC (548) +ELF-AARCH64: Type: R_AARCH64_TLSLE_ADD_TPREL_HI12 (549) +ELF-AARCH64: Type: R_AARCH64_TLSLE_ADD_TPREL_LO12 (550) +ELF-AARCH64: Type: R_AARCH64_TLSLE_ADD_TPREL_LO12_NC (551) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST8_TPREL_LO12 (552) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC (553) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST16_TPREL_LO12 (554) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC (555) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST32_TPREL_LO12 (556) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC (557) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST64_TPREL_LO12 (558) +ELF-AARCH64: Type: R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC (559) +ELF-AARCH64: Type: R_AARCH64_TLSDESC_ADR_PAGE (562) +ELF-AARCH64: Type: R_AARCH64_TLSDESC_LD64_LO12_NC (563) +ELF-AARCH64: Type: R_AARCH64_TLSDESC_ADD_LO12_NC (564) +ELF-AARCH64: Type: R_AARCH64_TLSDESC_CALL (569) + +ELF-ARM: Type: R_ARM_NONE (0) +ELF-ARM: Type: R_ARM_PC24 (1) +ELF-ARM: Type: R_ARM_ABS32 (2) +ELF-ARM: Type: R_ARM_REL32 (3) +ELF-ARM: Type: R_ARM_LDR_PC_G0 (4) +ELF-ARM: Type: R_ARM_ABS16 (5) +ELF-ARM: Type: R_ARM_ABS12 (6) +ELF-ARM: Type: R_ARM_THM_ABS5 (7) +ELF-ARM: Type: R_ARM_ABS8 (8) +ELF-ARM: Type: R_ARM_SBREL32 (9) +ELF-ARM: Type: R_ARM_THM_CALL (10) +ELF-ARM: Type: R_ARM_THM_PC8 (11) +ELF-ARM: Type: R_ARM_BREL_ADJ (12) +ELF-ARM: Type: R_ARM_TLS_DESC (13) +ELF-ARM: Type: R_ARM_THM_SWI8 (14) +ELF-ARM: Type: R_ARM_XPC25 (15) +ELF-ARM: Type: R_ARM_THM_XPC22 (16) +ELF-ARM: Type: R_ARM_TLS_DTPMOD32 (17) +ELF-ARM: Type: R_ARM_TLS_DTPOFF32 (18) +ELF-ARM: Type: R_ARM_TLS_TPOFF32 (19) +ELF-ARM: Type: R_ARM_COPY (20) +ELF-ARM: Type: R_ARM_GLOB_DAT (21) +ELF-ARM: Type: R_ARM_JUMP_SLOT (22) +ELF-ARM: Type: R_ARM_RELATIVE (23) +ELF-ARM: Type: R_ARM_GOTOFF32 (24) +ELF-ARM: Type: R_ARM_BASE_PREL (25) +ELF-ARM: Type: R_ARM_GOT_BREL (26) +ELF-ARM: Type: R_ARM_PLT32 (27) +ELF-ARM: Type: R_ARM_CALL (28) +ELF-ARM: Type: R_ARM_JUMP24 (29) +ELF-ARM: Type: R_ARM_THM_JUMP24 (30) +ELF-ARM: Type: R_ARM_BASE_ABS (31) +ELF-ARM: Type: R_ARM_ALU_PCREL_7_0 (32) +ELF-ARM: Type: R_ARM_ALU_PCREL_15_8 (33) +ELF-ARM: Type: R_ARM_ALU_PCREL_23_15 (34) +ELF-ARM: Type: R_ARM_LDR_SBREL_11_0_NC (35) +ELF-ARM: Type: R_ARM_ALU_SBREL_19_12_NC (36) +ELF-ARM: Type: R_ARM_ALU_SBREL_27_20_CK (37) +ELF-ARM: Type: R_ARM_TARGET1 (38) +ELF-ARM: Type: R_ARM_SBREL31 (39) +ELF-ARM: Type: R_ARM_V4BX (40) +ELF-ARM: Type: R_ARM_TARGET2 (41) +ELF-ARM: Type: R_ARM_PREL31 (42) +ELF-ARM: Type: R_ARM_MOVW_ABS_NC (43) +ELF-ARM: Type: R_ARM_MOVT_ABS (44) +ELF-ARM: Type: R_ARM_MOVW_PREL_NC (45) +ELF-ARM: Type: R_ARM_MOVT_PREL (46) +ELF-ARM: Type: R_ARM_THM_MOVW_ABS_NC (47) +ELF-ARM: Type: R_ARM_THM_MOVT_ABS (48) +ELF-ARM: Type: R_ARM_THM_MOVW_PREL_NC (49) +ELF-ARM: Type: R_ARM_THM_MOVT_PREL (50) +ELF-ARM: Type: R_ARM_THM_JUMP19 (51) +ELF-ARM: Type: R_ARM_THM_JUMP6 (52) +ELF-ARM: Type: R_ARM_THM_ALU_PREL_11_0 (53) +ELF-ARM: Type: R_ARM_THM_PC12 (54) +ELF-ARM: Type: R_ARM_ABS32_NOI (55) +ELF-ARM: Type: R_ARM_REL32_NOI (56) +ELF-ARM: Type: R_ARM_ALU_PC_G0_NC (57) +ELF-ARM: Type: R_ARM_ALU_PC_G0 (58) +ELF-ARM: Type: R_ARM_ALU_PC_G1_NC (59) +ELF-ARM: Type: R_ARM_ALU_PC_G1 (60) +ELF-ARM: Type: R_ARM_ALU_PC_G2 (61) +ELF-ARM: Type: R_ARM_LDR_PC_G1 (62) +ELF-ARM: Type: R_ARM_LDR_PC_G2 (63) +ELF-ARM: Type: R_ARM_LDRS_PC_G0 (64) +ELF-ARM: Type: R_ARM_LDRS_PC_G1 (65) +ELF-ARM: Type: R_ARM_LDRS_PC_G2 (66) +ELF-ARM: Type: R_ARM_LDC_PC_G0 (67) +ELF-ARM: Type: R_ARM_LDC_PC_G1 (68) +ELF-ARM: Type: R_ARM_LDC_PC_G2 (69) +ELF-ARM: Type: R_ARM_ALU_SB_G0_NC (70) +ELF-ARM: Type: R_ARM_ALU_SB_G0 (71) +ELF-ARM: Type: R_ARM_ALU_SB_G1_NC (72) +ELF-ARM: Type: R_ARM_ALU_SB_G1 (73) +ELF-ARM: Type: R_ARM_ALU_SB_G2 (74) +ELF-ARM: Type: R_ARM_LDR_SB_G0 (75) +ELF-ARM: Type: R_ARM_LDR_SB_G1 (76) +ELF-ARM: Type: R_ARM_LDR_SB_G2 (77) +ELF-ARM: Type: R_ARM_LDRS_SB_G0 (78) +ELF-ARM: Type: R_ARM_LDRS_SB_G1 (79) +ELF-ARM: Type: R_ARM_LDRS_SB_G2 (80) +ELF-ARM: Type: R_ARM_LDC_SB_G0 (81) +ELF-ARM: Type: R_ARM_LDC_SB_G1 (82) +ELF-ARM: Type: R_ARM_LDC_SB_G2 (83) +ELF-ARM: Type: R_ARM_MOVW_BREL_NC (84) +ELF-ARM: Type: R_ARM_MOVT_BREL (85) +ELF-ARM: Type: R_ARM_MOVW_BREL (86) +ELF-ARM: Type: R_ARM_THM_MOVW_BREL_NC (87) +ELF-ARM: Type: R_ARM_THM_MOVT_BREL (88) +ELF-ARM: Type: R_ARM_THM_MOVW_BREL (89) +ELF-ARM: Type: R_ARM_TLS_GOTDESC (90) +ELF-ARM: Type: R_ARM_TLS_CALL (91) +ELF-ARM: Type: R_ARM_TLS_DESCSEQ (92) +ELF-ARM: Type: R_ARM_THM_TLS_CALL (93) +ELF-ARM: Type: R_ARM_PLT32_ABS (94) +ELF-ARM: Type: R_ARM_GOT_ABS (95) +ELF-ARM: Type: R_ARM_GOT_PREL (96) +ELF-ARM: Type: R_ARM_GOT_BREL12 (97) +ELF-ARM: Type: R_ARM_GOTOFF12 (98) +ELF-ARM: Type: R_ARM_GOTRELAX (99) +ELF-ARM: Type: R_ARM_GNU_VTENTRY (100) +ELF-ARM: Type: R_ARM_GNU_VTINHERIT (101) +ELF-ARM: Type: R_ARM_THM_JUMP11 (102) +ELF-ARM: Type: R_ARM_THM_JUMP8 (103) +ELF-ARM: Type: R_ARM_TLS_GD32 (104) +ELF-ARM: Type: R_ARM_TLS_LDM32 (105) +ELF-ARM: Type: R_ARM_TLS_LDO32 (106) +ELF-ARM: Type: R_ARM_TLS_IE32 (107) +ELF-ARM: Type: R_ARM_TLS_LE32 (108) +ELF-ARM: Type: R_ARM_TLS_LDO12 (109) +ELF-ARM: Type: R_ARM_TLS_LE12 (110) +ELF-ARM: Type: R_ARM_TLS_IE12GP (111) +ELF-ARM: Type: R_ARM_PRIVATE_0 (112) +ELF-ARM: Type: R_ARM_PRIVATE_1 (113) +ELF-ARM: Type: R_ARM_PRIVATE_2 (114) +ELF-ARM: Type: R_ARM_PRIVATE_3 (115) +ELF-ARM: Type: R_ARM_PRIVATE_4 (116) +ELF-ARM: Type: R_ARM_PRIVATE_5 (117) +ELF-ARM: Type: R_ARM_PRIVATE_6 (118) +ELF-ARM: Type: R_ARM_PRIVATE_7 (119) +ELF-ARM: Type: R_ARM_PRIVATE_8 (120) +ELF-ARM: Type: R_ARM_PRIVATE_9 (121) +ELF-ARM: Type: R_ARM_PRIVATE_10 (122) +ELF-ARM: Type: R_ARM_PRIVATE_11 (123) +ELF-ARM: Type: R_ARM_PRIVATE_12 (124) +ELF-ARM: Type: R_ARM_PRIVATE_13 (125) +ELF-ARM: Type: R_ARM_PRIVATE_14 (126) +ELF-ARM: Type: R_ARM_PRIVATE_15 (127) +ELF-ARM: Type: R_ARM_ME_TOO (128) +ELF-ARM: Type: R_ARM_THM_TLS_DESCSEQ16 (129) +ELF-ARM: Type: R_ARM_THM_TLS_DESCSEQ32 (130) + +ELF-MIPS: Type: R_MIPS_NONE (0) +ELF-MIPS: Type: R_MIPS_16 (1) +ELF-MIPS: Type: R_MIPS_32 (2) +ELF-MIPS: Type: R_MIPS_REL32 (3) +ELF-MIPS: Type: R_MIPS_26 (4) +ELF-MIPS: Type: R_MIPS_HI16 (5) +ELF-MIPS: Type: R_MIPS_LO16 (6) +ELF-MIPS: Type: R_MIPS_GPREL16 (7) +ELF-MIPS: Type: R_MIPS_LITERAL (8) +ELF-MIPS: Type: R_MIPS_GOT16 (9) +ELF-MIPS: Type: R_MIPS_PC16 (10) +ELF-MIPS: Type: R_MIPS_CALL16 (11) +ELF-MIPS: Type: R_MIPS_GPREL32 (12) +ELF-MIPS: Type: R_MIPS_SHIFT5 (16) +ELF-MIPS: Type: R_MIPS_SHIFT6 (17) +ELF-MIPS: Type: R_MIPS_64 (18) +ELF-MIPS: Type: R_MIPS_GOT_DISP (19) +ELF-MIPS: Type: R_MIPS_GOT_PAGE (20) +ELF-MIPS: Type: R_MIPS_GOT_OFST (21) +ELF-MIPS: Type: R_MIPS_GOT_HI16 (22) +ELF-MIPS: Type: R_MIPS_GOT_LO16 (23) +ELF-MIPS: Type: R_MIPS_SUB (24) +ELF-MIPS: Type: R_MIPS_INSERT_A (25) +ELF-MIPS: Type: R_MIPS_INSERT_B (26) +ELF-MIPS: Type: R_MIPS_DELETE (27) +ELF-MIPS: Type: R_MIPS_HIGHER (28) +ELF-MIPS: Type: R_MIPS_HIGHEST (29) +ELF-MIPS: Type: R_MIPS_CALL_HI16 (30) +ELF-MIPS: Type: R_MIPS_CALL_LO16 (31) +ELF-MIPS: Type: R_MIPS_SCN_DISP (32) +ELF-MIPS: Type: R_MIPS_REL16 (33) +ELF-MIPS: Type: R_MIPS_ADD_IMMEDIATE (34) +ELF-MIPS: Type: R_MIPS_PJUMP (35) +ELF-MIPS: Type: R_MIPS_RELGOT (36) +ELF-MIPS: Type: R_MIPS_JALR (37) +ELF-MIPS: Type: R_MIPS_TLS_DTPMOD32 (38) +ELF-MIPS: Type: R_MIPS_TLS_DTPREL32 (39) +ELF-MIPS: Type: R_MIPS_TLS_DTPMOD64 (40) +ELF-MIPS: Type: R_MIPS_TLS_DTPREL64 (41) +ELF-MIPS: Type: R_MIPS_TLS_GD (42) +ELF-MIPS: Type: R_MIPS_TLS_LDM (43) +ELF-MIPS: Type: R_MIPS_TLS_DTPREL_HI16 (44) +ELF-MIPS: Type: R_MIPS_TLS_DTPREL_LO16 (45) +ELF-MIPS: Type: R_MIPS_TLS_GOTTPREL (46) +ELF-MIPS: Type: R_MIPS_TLS_TPREL32 (47) +ELF-MIPS: Type: R_MIPS_TLS_TPREL64 (48) +ELF-MIPS: Type: R_MIPS_TLS_TPREL_HI16 (49) +ELF-MIPS: Type: R_MIPS_TLS_TPREL_LO16 (50) +ELF-MIPS: Type: R_MIPS_GLOB_DAT (51) +ELF-MIPS: Type: R_MIPS_COPY (126) +ELF-MIPS: Type: R_MIPS_JUMP_SLOT (127) +ELF-MIPS: Type: R_MIPS_NUM (218) +ELF-MIPS64EL: Type: R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE (0) +ELF-MIPS64EL: Type: R_MIPS_16/R_MIPS_16/R_MIPS_16 (65793) +ELF-MIPS64EL: Type: R_MIPS_32/R_MIPS_32/R_MIPS_32 (131586) +ELF-MIPS64EL: Type: R_MIPS_REL32/R_MIPS_REL32/R_MIPS_REL32 (197379) +ELF-MIPS64EL: Type: R_MIPS_26/R_MIPS_26/R_MIPS_26 (263172) +ELF-MIPS64EL: Type: R_MIPS_HI16/R_MIPS_HI16/R_MIPS_HI16 (328965) +ELF-MIPS64EL: Type: R_MIPS_LO16/R_MIPS_LO16/R_MIPS_LO16 (394758) +ELF-MIPS64EL: Type: R_MIPS_GPREL16/R_MIPS_GPREL16/R_MIPS_GPREL16 (460551) +ELF-MIPS64EL: Type: R_MIPS_LITERAL/R_MIPS_LITERAL/R_MIPS_LITERAL (526344) +ELF-MIPS64EL: Type: R_MIPS_GOT16/R_MIPS_GOT16/R_MIPS_GOT16 (592137) +ELF-MIPS64EL: Type: R_MIPS_PC16/R_MIPS_PC16/R_MIPS_PC16 (657930) +ELF-MIPS64EL: Type: R_MIPS_CALL16/R_MIPS_CALL16/R_MIPS_CALL16 (723723) +ELF-MIPS64EL: Type: R_MIPS_GPREL32/R_MIPS_GPREL32/R_MIPS_GPREL32 (789516) +ELF-MIPS64EL: Type: R_MIPS_SHIFT5/R_MIPS_SHIFT5/R_MIPS_SHIFT5 (1052688) +ELF-MIPS64EL: Type: R_MIPS_SHIFT6/R_MIPS_SHIFT6/R_MIPS_SHIFT6 (1118481) +ELF-MIPS64EL: Type: R_MIPS_64/R_MIPS_64/R_MIPS_64 (1184274) +ELF-MIPS64EL: Type: R_MIPS_GOT_DISP/R_MIPS_GOT_DISP/R_MIPS_GOT_DISP (1250067) +ELF-MIPS64EL: Type: R_MIPS_GOT_PAGE/R_MIPS_GOT_PAGE/R_MIPS_GOT_PAGE (1315860) +ELF-MIPS64EL: Type: R_MIPS_GOT_OFST/R_MIPS_GOT_OFST/R_MIPS_GOT_OFST (1381653) +ELF-MIPS64EL: Type: R_MIPS_GOT_HI16/R_MIPS_GOT_HI16/R_MIPS_GOT_HI16 (1447446) +ELF-MIPS64EL: Type: R_MIPS_GOT_LO16/R_MIPS_GOT_LO16/R_MIPS_GOT_LO16 (1513239) +ELF-MIPS64EL: Type: R_MIPS_SUB/R_MIPS_SUB/R_MIPS_SUB (1579032) +ELF-MIPS64EL: Type: R_MIPS_INSERT_A/R_MIPS_INSERT_A/R_MIPS_INSERT_A (1644825) +ELF-MIPS64EL: Type: R_MIPS_INSERT_B/R_MIPS_INSERT_B/R_MIPS_INSERT_B (1710618) +ELF-MIPS64EL: Type: R_MIPS_DELETE/R_MIPS_DELETE/R_MIPS_DELETE (1776411) +ELF-MIPS64EL: Type: R_MIPS_HIGHER/R_MIPS_HIGHER/R_MIPS_HIGHER (1842204) +ELF-MIPS64EL: Type: R_MIPS_HIGHEST/R_MIPS_HIGHEST/R_MIPS_HIGHEST (1907997) +ELF-MIPS64EL: Type: R_MIPS_CALL_HI16/R_MIPS_CALL_HI16/R_MIPS_CALL_HI16 (1973790) +ELF-MIPS64EL: Type: R_MIPS_CALL_LO16/R_MIPS_CALL_LO16/R_MIPS_CALL_LO16 (2039583) +ELF-MIPS64EL: Type: R_MIPS_SCN_DISP/R_MIPS_SCN_DISP/R_MIPS_SCN_DISP (2105376) +ELF-MIPS64EL: Type: R_MIPS_REL16/R_MIPS_REL16/R_MIPS_REL16 (2171169) +ELF-MIPS64EL: Type: R_MIPS_ADD_IMMEDIATE/R_MIPS_ADD_IMMEDIATE/R_MIPS_ADD_IMMEDIATE (2236962) +ELF-MIPS64EL: Type: R_MIPS_PJUMP/R_MIPS_PJUMP/R_MIPS_PJUMP (2302755) +ELF-MIPS64EL: Type: R_MIPS_RELGOT/R_MIPS_RELGOT/R_MIPS_RELGOT (2368548) +ELF-MIPS64EL: Type: R_MIPS_JALR/R_MIPS_JALR/R_MIPS_JALR (2434341) +ELF-MIPS64EL: Type: R_MIPS_TLS_DTPMOD32/R_MIPS_TLS_DTPMOD32/R_MIPS_TLS_DTPMOD32 (2500134) +ELF-MIPS64EL: Type: R_MIPS_TLS_DTPREL32/R_MIPS_TLS_DTPREL32/R_MIPS_TLS_DTPREL32 (2565927) +ELF-MIPS64EL: Type: R_MIPS_TLS_DTPMOD64/R_MIPS_TLS_DTPMOD64/R_MIPS_TLS_DTPMOD64 (2631720) +ELF-MIPS64EL: Type: R_MIPS_TLS_DTPREL64/R_MIPS_TLS_DTPREL64/R_MIPS_TLS_DTPREL64 (2697513) +ELF-MIPS64EL: Type: R_MIPS_TLS_GD/R_MIPS_TLS_GD/R_MIPS_TLS_GD (2763306) +ELF-MIPS64EL: Type: R_MIPS_TLS_LDM/R_MIPS_TLS_LDM/R_MIPS_TLS_LDM (2829099) +ELF-MIPS64EL: Type: R_MIPS_TLS_DTPREL_HI16/R_MIPS_TLS_DTPREL_HI16/R_MIPS_TLS_DTPREL_HI16 (2894892) +ELF-MIPS64EL: Type: R_MIPS_TLS_DTPREL_LO16/R_MIPS_TLS_DTPREL_LO16/R_MIPS_TLS_DTPREL_LO16 (2960685) +ELF-MIPS64EL: Type: R_MIPS_TLS_GOTTPREL/R_MIPS_TLS_GOTTPREL/R_MIPS_TLS_GOTTPREL (3026478) +ELF-MIPS64EL: Type: R_MIPS_TLS_TPREL32/R_MIPS_TLS_TPREL32/R_MIPS_TLS_TPREL32 (3092271) +ELF-MIPS64EL: Type: R_MIPS_TLS_TPREL64/R_MIPS_TLS_TPREL64/R_MIPS_TLS_TPREL64 (3158064) +ELF-MIPS64EL: Type: R_MIPS_TLS_TPREL_HI16/R_MIPS_TLS_TPREL_HI16/R_MIPS_TLS_TPREL_HI16 (3223857) +ELF-MIPS64EL: Type: R_MIPS_TLS_TPREL_LO16/R_MIPS_TLS_TPREL_LO16/R_MIPS_TLS_TPREL_LO16 (3289650) +ELF-MIPS64EL: Type: R_MIPS_GLOB_DAT/R_MIPS_GLOB_DAT/R_MIPS_GLOB_DAT (3355443) +ELF-MIPS64EL: Type: R_MIPS_COPY/R_MIPS_COPY/R_MIPS_COPY (8289918) +ELF-MIPS64EL: Type: R_MIPS_JUMP_SLOT/R_MIPS_JUMP_SLOT/R_MIPS_JUMP_SLOT (8355711) +ELF-MIPS64EL: Type: R_MIPS_NUM/R_MIPS_NUM/R_MIPS_NUM (14342874) + +ELF-MBLAZE: Type: R_MICROBLAZE_NONE (0) +ELF-MBLAZE: Type: R_MICROBLAZE_32 (1) +ELF-MBLAZE: Type: R_MICROBLAZE_32_PCREL (2) +ELF-MBLAZE: Type: R_MICROBLAZE_64_PCREL (3) +ELF-MBLAZE: Type: R_MICROBLAZE_32_PCREL_LO (4) +ELF-MBLAZE: Type: R_MICROBLAZE_64 (5) +ELF-MBLAZE: Type: R_MICROBLAZE_32_LO (6) +ELF-MBLAZE: Type: R_MICROBLAZE_SRO32 (7) +ELF-MBLAZE: Type: R_MICROBLAZE_SRW32 (8) +ELF-MBLAZE: Type: R_MICROBLAZE_64_NONE (9) +ELF-MBLAZE: Type: R_MICROBLAZE_32_SYM_OP_SYM (10) +ELF-MBLAZE: Type: R_MICROBLAZE_GNU_VTINHERIT (11) +ELF-MBLAZE: Type: R_MICROBLAZE_GNU_VTENTRY (12) +ELF-MBLAZE: Type: R_MICROBLAZE_GOTPC_64 (13) +ELF-MBLAZE: Type: R_MICROBLAZE_GOT_64 (14) +ELF-MBLAZE: Type: R_MICROBLAZE_PLT_64 (15) +ELF-MBLAZE: Type: R_MICROBLAZE_REL (16) +ELF-MBLAZE: Type: R_MICROBLAZE_JUMP_SLOT (17) +ELF-MBLAZE: Type: R_MICROBLAZE_GLOB_DAT (18) +ELF-MBLAZE: Type: R_MICROBLAZE_GOTOFF_64 (19) +ELF-MBLAZE: Type: R_MICROBLAZE_GOTOFF_32 (20) +ELF-MBLAZE: Type: R_MICROBLAZE_COPY (21) + +ELF-HEXAGON: Type: R_HEX_NONE (0) +ELF-HEXAGON: Type: R_HEX_B22_PCREL (1) +ELF-HEXAGON: Type: R_HEX_B15_PCREL (2) +ELF-HEXAGON: Type: R_HEX_B7_PCREL (3) +ELF-HEXAGON: Type: R_HEX_LO16 (4) +ELF-HEXAGON: Type: R_HEX_HI16 (5) +ELF-HEXAGON: Type: R_HEX_32 (6) +ELF-HEXAGON: Type: R_HEX_16 (7) +ELF-HEXAGON: Type: R_HEX_8 (8) +ELF-HEXAGON: Type: R_HEX_GPREL16_0 (9) +ELF-HEXAGON: Type: R_HEX_GPREL16_1 (10) +ELF-HEXAGON: Type: R_HEX_GPREL16_2 (11) +ELF-HEXAGON: Type: R_HEX_GPREL16_3 (12) +ELF-HEXAGON: Type: R_HEX_HL16 (13) +ELF-HEXAGON: Type: R_HEX_B13_PCREL (14) +ELF-HEXAGON: Type: R_HEX_B9_PCREL (15) +ELF-HEXAGON: Type: R_HEX_B32_PCREL_X (16) +ELF-HEXAGON: Type: R_HEX_32_6_X (17) +ELF-HEXAGON: Type: R_HEX_B22_PCREL_X (18) +ELF-HEXAGON: Type: R_HEX_B15_PCREL_X (19) +ELF-HEXAGON: Type: R_HEX_B13_PCREL_X (20) +ELF-HEXAGON: Type: R_HEX_B9_PCREL_X (21) +ELF-HEXAGON: Type: R_HEX_B7_PCREL_X (22) +ELF-HEXAGON: Type: R_HEX_16_X (23) +ELF-HEXAGON: Type: R_HEX_12_X (24) +ELF-HEXAGON: Type: R_HEX_11_X (25) +ELF-HEXAGON: Type: R_HEX_10_X (26) +ELF-HEXAGON: Type: R_HEX_9_X (27) +ELF-HEXAGON: Type: R_HEX_8_X (28) +ELF-HEXAGON: Type: R_HEX_7_X (29) +ELF-HEXAGON: Type: R_HEX_6_X (30) +ELF-HEXAGON: Type: R_HEX_32_PCREL (31) +ELF-HEXAGON: Type: R_HEX_COPY (32) +ELF-HEXAGON: Type: R_HEX_GLOB_DAT (33) +ELF-HEXAGON: Type: R_HEX_JMP_SLOT (34) +ELF-HEXAGON: Type: R_HEX_RELATIVE (35) +ELF-HEXAGON: Type: R_HEX_PLT_B22_PCREL (36) +ELF-HEXAGON: Type: R_HEX_GOTREL_LO16 (37) +ELF-HEXAGON: Type: R_HEX_GOTREL_HI16 (38) +ELF-HEXAGON: Type: R_HEX_GOTREL_32 (39) +ELF-HEXAGON: Type: R_HEX_GOT_LO16 (40) +ELF-HEXAGON: Type: R_HEX_GOT_HI16 (41) +ELF-HEXAGON: Type: R_HEX_GOT_32 (42) +ELF-HEXAGON: Type: R_HEX_GOT_16 (43) +ELF-HEXAGON: Type: R_HEX_DTPMOD_32 (44) +ELF-HEXAGON: Type: R_HEX_DTPREL_LO16 (45) +ELF-HEXAGON: Type: R_HEX_DTPREL_HI16 (46) +ELF-HEXAGON: Type: R_HEX_DTPREL_32 (47) +ELF-HEXAGON: Type: R_HEX_DTPREL_16 (48) +ELF-HEXAGON: Type: R_HEX_GD_PLT_B22_PCREL (49) +ELF-HEXAGON: Type: R_HEX_GD_GOT_LO16 (50) +ELF-HEXAGON: Type: R_HEX_GD_GOT_HI16 (51) +ELF-HEXAGON: Type: R_HEX_GD_GOT_32 (52) +ELF-HEXAGON: Type: R_HEX_GD_GOT_16 (53) +ELF-HEXAGON: Type: R_HEX_IE_LO16 (54) +ELF-HEXAGON: Type: R_HEX_IE_HI16 (55) +ELF-HEXAGON: Type: R_HEX_IE_32 (56) +ELF-HEXAGON: Type: R_HEX_IE_GOT_LO16 (57) +ELF-HEXAGON: Type: R_HEX_IE_GOT_HI16 (58) +ELF-HEXAGON: Type: R_HEX_IE_GOT_32 (59) +ELF-HEXAGON: Type: R_HEX_IE_GOT_16 (60) +ELF-HEXAGON: Type: R_HEX_TPREL_LO16 (61) +ELF-HEXAGON: Type: R_HEX_TPREL_HI16 (62) +ELF-HEXAGON: Type: R_HEX_TPREL_32 (63) +ELF-HEXAGON: Type: R_HEX_TPREL_16 (64) +ELF-HEXAGON: Type: R_HEX_6_PCREL_X (65) +ELF-HEXAGON: Type: R_HEX_GOTREL_32_6_X (66) +ELF-HEXAGON: Type: R_HEX_GOTREL_16_X (67) +ELF-HEXAGON: Type: R_HEX_GOTREL_11_X (68) +ELF-HEXAGON: Type: R_HEX_GOT_32_6_X (69) +ELF-HEXAGON: Type: R_HEX_GOT_16_X (70) +ELF-HEXAGON: Type: R_HEX_GOT_11_X (71) +ELF-HEXAGON: Type: R_HEX_DTPREL_32_6_X (72) +ELF-HEXAGON: Type: R_HEX_DTPREL_16_X (73) +ELF-HEXAGON: Type: R_HEX_DTPREL_11_X (74) +ELF-HEXAGON: Type: R_HEX_GD_GOT_32_6_X (75) +ELF-HEXAGON: Type: R_HEX_GD_GOT_16_X (76) +ELF-HEXAGON: Type: R_HEX_GD_GOT_11_X (77) +ELF-HEXAGON: Type: R_HEX_IE_32_6_X (78) +ELF-HEXAGON: Type: R_HEX_IE_16_X (79) +ELF-HEXAGON: Type: R_HEX_IE_GOT_32_6_X (80) +ELF-HEXAGON: Type: R_HEX_IE_GOT_16_X (81) +ELF-HEXAGON: Type: R_HEX_IE_GOT_11_X (82) +ELF-HEXAGON: Type: R_HEX_TPREL_32_6_X (83) +ELF-HEXAGON: Type: R_HEX_TPREL_16_X (84) +ELF-HEXAGON: Type: R_HEX_TPREL_11_X (85) + +COFF-32: Type: IMAGE_REL_I386_ABSOLUTE (0) +COFF-32: Type: IMAGE_REL_I386_DIR16 (1) +COFF-32: Type: IMAGE_REL_I386_REL16 (2) +COFF-32: Type: IMAGE_REL_I386_DIR32 (6) +COFF-32: Type: IMAGE_REL_I386_DIR32NB (7) +COFF-32: Type: IMAGE_REL_I386_SEG12 (9) +COFF-32: Type: IMAGE_REL_I386_SECTION (10) +COFF-32: Type: IMAGE_REL_I386_SECREL (11) +COFF-32: Type: IMAGE_REL_I386_TOKEN (12) +COFF-32: Type: IMAGE_REL_I386_SECREL7 (13) +COFF-32: Type: IMAGE_REL_I386_REL32 (20) + +COFF-64: Type: IMAGE_REL_AMD64_ABSOLUTE (0) +COFF-64: Type: IMAGE_REL_AMD64_ADDR64 (1) +COFF-64: Type: IMAGE_REL_AMD64_ADDR32 (2) +COFF-64: Type: IMAGE_REL_AMD64_ADDR32NB (3) +COFF-64: Type: IMAGE_REL_AMD64_REL32 (4) +COFF-64: Type: IMAGE_REL_AMD64_REL32_1 (5) +COFF-64: Type: IMAGE_REL_AMD64_REL32_2 (6) +COFF-64: Type: IMAGE_REL_AMD64_REL32_3 (7) +COFF-64: Type: IMAGE_REL_AMD64_REL32_4 (8) +COFF-64: Type: IMAGE_REL_AMD64_REL32_5 (9) +COFF-64: Type: IMAGE_REL_AMD64_SECTION (10) +COFF-64: Type: IMAGE_REL_AMD64_SECREL (11) +COFF-64: Type: IMAGE_REL_AMD64_SECREL7 (12) +COFF-64: Type: IMAGE_REL_AMD64_TOKEN (13) +COFF-64: Type: IMAGE_REL_AMD64_SREL32 (14) +COFF-64: Type: IMAGE_REL_AMD64_PAIR (15) +COFF-64: Type: IMAGE_REL_AMD64_SSPAN32 (16) + +COFF-ARM: Type: IMAGE_REL_ARM_ABSOLUTE (0x0000) +COFF-ARM: Type: IMAGE_REL_ARM_ADDR32 (0x0001) +COFF-ARM: Type: IMAGE_REL_ARM_ADDR32NB (0x0002) +COFF-ARM: Type: IMAGE_REL_ARM_BRANCH24 (0x0003) +COFF-ARM: Type: IMAGE_REL_ARM_BRANCH11 (0x0004) +COFF-ARM: Type: IMAGE_REL_ARM_TOKEN (0x0005) +COFF-ARM: Type: IMAGE_REL_ARM_BLX24 (0x0008) +COFF-ARM: Type: IMAGE_REL_ARM_BLX11 (0x0009) +COFF-ARM: Type: IMAGE_REL_ARM_SECTION (0x000E) +COFF-ARM: Type: IMAGE_REL_ARM_SECREL (0x000F) +COFF-ARM: Type: IMAGE_REL_ARM_MOV32A (0x0010) +COFF-ARM: Type: IMAGE_REL_ARM_MOV32T (0x0011) +COFF-ARM: Type: IMAGE_REL_ARM_BRANCH20T (0x0012) +COFF-ARM: Type: IMAGE_REL_ARM_BRANCH24T (0x0014) +COFF-ARM: Type: IMAGE_REL_ARM_BLX23T (0x0015) + +MACHO-32: Type: GENERIC_RELOC_VANILLA (0) +MACHO-32: Type: GENERIC_RELOC_PAIR (1) +MACHO-32: Type: GENERIC_RELOC_SECTDIFF (2) +MACHO-32: Type: GENERIC_RELOC_PB_LA_PTR (3) +MACHO-32: Type: GENERIC_RELOC_LOCAL_SECTDIFF (4) +MACHO-32: Type: GENERIC_RELOC_TLV (5) + +MACHO-64: Type: X86_64_RELOC_UNSIGNED (0) +MACHO-64: Type: X86_64_RELOC_SIGNED (1) +MACHO-64: Type: X86_64_RELOC_BRANCH (2) +MACHO-64: Type: X86_64_RELOC_GOT_LOAD (3) +MACHO-64: Type: X86_64_RELOC_GOT (4) +MACHO-64: Type: X86_64_RELOC_SUBTRACTOR (5) +MACHO-64: Type: X86_64_RELOC_SIGNED_1 (6) +MACHO-64: Type: X86_64_RELOC_SIGNED_2 (7) +MACHO-64: Type: X86_64_RELOC_SIGNED_4 (8) +MACHO-64: Type: X86_64_RELOC_TLV (9) + +MACHO-ARM: Type: ARM_RELOC_VANILLA (0) +MACHO-ARM: Type: ARM_RELOC_PAIR (1) +MACHO-ARM: Type: ARM_RELOC_SECTDIFF (2) +MACHO-ARM: Type: ARM_RELOC_LOCAL_SECTDIFF (3) +MACHO-ARM: Type: ARM_RELOC_PB_LA_PTR (4) +MACHO-ARM: Type: ARM_RELOC_BR24 (5) +MACHO-ARM: Type: ARM_THUMB_RELOC_BR22 (6) +MACHO-ARM: Type: ARM_THUMB_32BIT_BRANCH (7) +MACHO-ARM: Type: ARM_RELOC_HALF (8) +MACHO-ARM: Type: ARM_RELOC_HALF_SECTDIFF (9) + +MACHO-PPC: PPC_RELOC_VANILLA (0) +MACHO-PPC: PPC_RELOC_PAIR (1) +MACHO-PPC: PPC_RELOC_BR14 (2) +MACHO-PPC: PPC_RELOC_BR24 (3) +MACHO-PPC: PPC_RELOC_HI16 (4) +MACHO-PPC: PPC_RELOC_LO16 (5) +MACHO-PPC: PPC_RELOC_HA16 (6) +MACHO-PPC: PPC_RELOC_LO14 (7) +MACHO-PPC: PPC_RELOC_SECTDIFF (8) +MACHO-PPC: PPC_RELOC_PB_LA_PTR (9) +MACHO-PPC: PPC_RELOC_HI16_SECTDIFF (10) +MACHO-PPC: PPC_RELOC_LO16_SECTDIFF (11) +MACHO-PPC: PPC_RELOC_HA16_SECTDIFF (12) +MACHO-PPC: PPC_RELOC_JBSR (13) +MACHO-PPC: PPC_RELOC_LO14_SECTDIFF (14) +MACHO-PPC: PPC_RELOC_LOCAL_SECTDIFF (15) -- 2.34.1