[PATCH] D22776: [ARM] Set the thumb flag for all text segments on COFF (partial revert of recent commit)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 14:00:31 PDT 2016


mstorsjo added a comment.

In https://reviews.llvm.org/D22776#495277, @rengolin wrote:

> > When assembling files via clang, even if the target triple set on the command line is e.g. thumb-win32, the driver sets the triple to armv7--windows-msvc18.0.0 (or similar; see tools/clang/lib/Driver/ToolChain.cpp) since assembly files should start in ARM mode by default.
>
>
> This makes no sense. If this is an assembly file, it should have some Thumb markers (.code 16, .thumb_func)  to be classified as Thumb.


True (and the code I'm working with obviously has such markers as well). Even if files have Thumb markers, the code currently just looks for the triplet (which was set at the start of the session), disregarding whatever mode currently is used.

> You can't just assume it's Thumb because "COFF is probably Windows".


True, although that assumption is pretty widespread so far (which of course isn't a reason to spread it further).

Prior to SVN rev 273880, such files assembled correctly at least (even if the non-existent non-thumb ARM Windows assembly didn't).

How much harder is a proper fix for this issue? (I'm quite unfamiliar with the LLVM codebase so far, and unfortunately don't have much time to spare. So in case it's a much larger scope, I'm afraid I'll have to defer this to a bug report.)


https://reviews.llvm.org/D22776





More information about the llvm-commits mailing list