From 2f913e3c6c3a42c0055df5cc6007e0064df3dec0 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 3 Apr 2014 02:27:00 +0000 Subject: [PATCH] Add support for the R_ARM_ABS32 relocation. This should bring the arm buildbots back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205502 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/RelocVisitor.h | 13 +++++++++++++ test/DebugInfo/Inputs/arm-relocs.elf-arm | Bin 0 -> 3012 bytes test/DebugInfo/arm-relocs.test | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 test/DebugInfo/Inputs/arm-relocs.elf-arm create mode 100644 test/DebugInfo/arm-relocs.test diff --git a/include/llvm/Object/RelocVisitor.h b/include/llvm/Object/RelocVisitor.h index c72db2ce412..a3aaf17f1d6 100644 --- a/include/llvm/Object/RelocVisitor.h +++ b/include/llvm/Object/RelocVisitor.h @@ -153,6 +153,14 @@ public: HasError = true; return RelocToApply(); } + } else if (FileFormat == "ELF32-arm") { + switch (RelocType) { + default: + HasError = true; + return RelocToApply(); + case llvm::ELF::R_ARM_ABS32: + return visitELF_ARM_ABS32(R, Value); + } } HasError = true; return RelocToApply(); @@ -325,6 +333,11 @@ private: return RelocToApply(Value + Addend, 8); } + RelocToApply visitELF_ARM_ABS32(RelocationRef R, uint64_t Value) { + int64_t Addend = getAddend32LE(R); + return RelocToApply(Value + Addend, 4); + } + }; } diff --git a/test/DebugInfo/Inputs/arm-relocs.elf-arm b/test/DebugInfo/Inputs/arm-relocs.elf-arm new file mode 100644 index 0000000000000000000000000000000000000000..4864c36256f3ff8cccb31fb787dee4c77a89a359 GIT binary patch literal 3012 zcma)8O>7%Q6n?X7C#mghn>e9q8`@MjkQB6y6Q@l|Xc~zkLK`IDK!rfYj-AvZ*%;di zDdHyr2_)3;Bjtb);?x^L>H#4R9C|@Q;*t{wZWM7r;(){f!6AI#?v8iX9NvEAHBl#EcBOjMAuDBP)PNdPN9`eXObx3K5eWzrekTdwNGzHYC>T)EPxGrDrGh-a zK7btdt({QnlGGf^RzB|lNnYrpTP1Fywmu3wPADtvw42dnLR6m`b+Sp@Ins5)L1sa0 zXE8gUxsZN1ZKcpGp=>9eCKO4GAv)ZPhOT<|l4Cn`&u1pneX3twLUtFM)47;sc~t+v(*jIam}WRc~|MU9Q)GAxZyB45Z$^V)Y>HUbuXZ?7=#TQj%v; zuWWkDP$D^$D1l$FnwQt9CWW)Fc`ei;%WEZXb!4mBXx28oktw$@5_NpGwO$ABqC6p2 z*u3~$f&5!RFV{#_ZWD>zzAZZ$P;xnxsMnlKuN?6^2`a9@qYgf`+o-O&3r{b()$Lkk zTii;uyt!H|mCKFlmbk6zc1zrHvnhT~snu%K%A2h!Fxv&m_04kYM*Uwtue45Ikki1- zBGha(OoE!XvSH%2npZXPN&{4yX>DU!+~##qv`S@ITHjdrai!EM8T0%vldHv5_V*%m z0fpa2OSlg}2?|z*G&AupaplF-eL)oJd zijKVsd`LT?|G?({82TO*9zTwceRB`!HZa8ksL=>T$KD6lHbXA~%!WBsI`$rHv)`LI zN$iLHQtN)7g00)Ylv@C&X@sI7%z-aQBNWZ|39!lcrNNg)O!IvOTkm;Nya>J@XoRBs`VJVO zw)}|$bq9{4@QkC7kK?_AV)A{BLCk6r#0(QC64RfM-w((eiHgmIy-k@7@I|MhWLSN2 zA%<;vGKL*F9&4YJQ!(5vxfo8#cnoL6jp3}!ckn+0%