]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r304530:
authordim <dim@FreeBSD.org>
Tue, 23 Aug 2016 05:22:03 +0000 (05:22 +0000)
committerdim <dim@FreeBSD.org>
Tue, 23 Aug 2016 05:22:03 +0000 (05:22 +0000)
commit592578a29b15e802c446a92c776cc7a576e8c206
treeea617e9446a5c9850d51376da764632143523b82
parent0cf4441e5a3fd2282077580f60b2165bd1035488
MFC r304530:

Pull in r265122 from upstream llvm trunk (by James Molloy):

  Fix for pr24346: arm asm label calculation error in sub

  Some ARM instructions encode 32-bit immediates as a 8-bit integer
  (0-255) and a 4-bit rotation (0-30, even) in its least significant 12
  bits. The original fixup, FK_Data_4, patches the instruction by the
  value bit-to-bit, regardless of the encoding. For example, assuming
  the label L1 and L2 are 0x0 and 0x104 respectively, the following
  instruction:

    add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

  would be assembled to the following, which adds 1 to r0, instead of
  260:

    e2800104 add r0, r0, #4, 2 ; equivalently 1

  The new fixup kind fixup_arm_mod_imm takes care of the encoding:

    e2800f41 add r0, r0, #260

  Patch by Ting-Yuan Huang!

This fixes label calculation for ARM assembly, and is needed to enable
ARM assembly sources for OpenSSL.

Requested by: jkim
contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h
contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
lib/clang/freebsd_cc_version.h