[PATCH] D34622: [Linker] Add directives to support mixing ARM/Thumb module-level inline asm.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 09:52:33 PDT 2017


tejohnson added a comment.

This looks ok to me now, but please wait for echristo to see if he has more concerns or a different suggestion for handling this situation.



================
Comment at: lib/Linker/IRMover.cpp:1299
+    // and Thumb modules.
+    if (SrcTriple.getArch() == Triple::thumb ||
+        SrcTriple.getArch() == Triple::thumbeb)
----------------
fhahn wrote:
> tejohnson wrote:
> > Should this first check if the dest module is of the other arch before emitting these?
> > 
> > I guess by always emitting then you don't have to worry about needing to switch the arch again back to the dest arch. I.e. in the case where the dest module is arm, a source module with thumb inline assembly linked in, followed by another source module with arm inline assembly being linked in (I assume this needs to get ".thumb" for source module 1 and then ".arm" for source module 2). Is that why it is being unconditionally emitted? 
> Exactly. Also I think there are cases where we have to emit .arm even though we merge an ARM module into an ARM module. For example: We merge module M1 - Thumb and module M2 - ARM into an ARM module.
> 
> We have to emit .arm for the inline assembly of M2 (even thought the dest module is also ARM), because M1 set .thumb.
> 
Ok, that's what I thought - that was the scenario I was trying to describe.


https://reviews.llvm.org/D34622





More information about the llvm-commits mailing list