[PATCH] [lld][ARM] Add relocations to perform function calls

Denis Protivensky dprotivensky at accesssoftek.com
Wed Jan 28 02:29:01 PST 2015

Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp:113
@@ +112,3 @@
+                                 uint16_t maskLo = 0xFFFF) {
+  assert(!(resHi & ~maskHi) && !(resLo & ~maskLo));
+  *reinterpret_cast<llvm::support::ulittle16_t *>(location) =
wnewton wrote:
> I guess this assert and the one in applyArmReloc are the points where error checking happens. It would be good to use the error checking functionality instead as the asserts will get removed in release builds.
This assert prevents from programmer's mistake when they specify a mask that doesn't correspond to bits in the result.
I agree that error checking is needed (may be added later), but this assert serves for another purpose.

Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp:161
@@ +160,3 @@
+  DECLARE_T(addressesThumb);
+  const bool exchanges = !addressesThumb;
wnewton wrote:
> "addressesThumb" is IMO a more descriptive name than "exchanges" so this variable does not help me to read the code.
I also doubted about this name, but I'd like to introduce some variable to point that addressing Thumb (or ARM) code for some instructions means 'exchange instruction set'. Any ideas about better name?



More information about the llvm-commits mailing list