diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-06-08 03:57:49 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-06-08 03:57:49 +0000 |
commit | 70a0206e4b1a5210c8391ef171a42caaeee3fd47 (patch) | |
tree | f822795be23efa8f7a98e85cc007ca7a3d7be549 /llvm/test/MC/ARM/Windows/text-attributes.s | |
parent | 491c33e9557a0957749f89c2bd6f4c8215cfeec8 (diff) | |
download | bcm5719-llvm-70a0206e4b1a5210c8391ef171a42caaeee3fd47.tar.gz bcm5719-llvm-70a0206e4b1a5210c8391ef171a42caaeee3fd47.zip |
MC: fix text section characteristics for WoA
link.exe requires that the text section has the IMAGE_SCN_MEM_16BIT flag set.
Otherwise, it will treat the function as ARM. If this occurs, then jumps to the
function will fail, switching from thumb to ARM mode execution.
With this change, it is possible to link using the MSVC linker as well.
llvm-svn: 210415
Diffstat (limited to 'llvm/test/MC/ARM/Windows/text-attributes.s')
-rw-r--r-- | llvm/test/MC/ARM/Windows/text-attributes.s | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/MC/ARM/Windows/text-attributes.s b/llvm/test/MC/ARM/Windows/text-attributes.s new file mode 100644 index 00000000000..62aa028789f --- /dev/null +++ b/llvm/test/MC/ARM/Windows/text-attributes.s @@ -0,0 +1,30 @@ +@ RUN: llvm-mc -triple thumbv7-windows-itanium -filetype obj -o - %s \ +@ RUN: | llvm-readobj -s - | FileCheck %s + + .syntax unified + .thumb + + .text + + .def function + .type 32 + .scl 2 + .endef + .global function + .thumb_func +function: + bx lr + +@ CHECK: Sections [ +@ CHECK: Section { +@ CHECK: Name: .text +@ CHECK: Characteristics [ +@ CHECK: IMAGE_SCN_ALIGN_4BYTES +@ CHECK: IMAGE_SCN_CNT_CODE +@ CHECK: IMAGE_SCN_MEM_16BIT +@ CHECK: IMAGE_SCN_MEM_EXECUTE +@ CHECK: IMAGE_SCN_MEM_PURGEABLE +@ CHECK: IMAGE_SCN_MEM_READ +@ CHECK: ] +@ CHECK: } +@ CHECK: ] |