[PATCH] [lld][ELF][ARM] Generate PLT entries for function calls from ARM and Thumb code
Shankar Kalpathi Easwaran
shankarke at gmail.com
Tue Mar 31 08:59:01 PDT 2015
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp:296-308
@@ +295,15 @@
+ /// \brief get a veneer for a PLT entry.
+ const PLTAtom *getPLTVeneer(const DefinedAtom *da, PLTAtom *pa,
+ StringRef source) {
+ auto va = new (_file._alloc) ARMPLTVeneerAtom(_file);
+ // Fake reference to show connection between veneer and PLT entry.
+ va->addReferenceELF_ARM(R_ARM_NONE, 0, pa, 0);
+#ifndef NDEBUG
+ va->_name = "__plt_from_thumb";
+ va->_name += source;
+ va->_name += da->name();
+#endif
+ _pltAtoms[da] = PLTWithVeneer(pa, va);
+ return va;
+ }
+
----------------
Isnt a seperate entry in the PLT for a thumb call preferred ?
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp:555-556
@@ -472,6 +554,4 @@
StringRef secName) {
- auto veneer = _veneerMap.find(da);
- if (_veneerMap.end() != veneer)
- return veneer->second;
-
+ if (auto veneer = _veneerAtoms.lookup(da))
+ return veneer;
auto v = new (_file._alloc) Veneer_THM_B_BL_StaticAtom(_file, secName);
----------------
Say for example you call the same atom from thumb/arm, the current code would reuse the veneer generated by ARM for thumb too, is this correct ?
http://reviews.llvm.org/D8701
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list