[MC][ARM] make Thumb function also if type attribute is set
authorStefan Agner <stefan@agner.ch>
Wed, 24 Feb 2021 21:47:40 +0000 (13:47 -0800)
committerNick Desaulniers <ndesaulniers@google.com>
Wed, 24 Feb 2021 22:08:56 +0000 (14:08 -0800)
commita921aaf789912d981cbb2036bdc91ad7289e1523
tree5ea8355019225628e7ee5737d94af46a3f441e97
parentae7528a34e2771ba4f0741e4941f78810854103d
[MC][ARM] make Thumb function also if type attribute is set

Make sure to set the bottom bit of the symbol even when the type
attribute of a label is set after the label.

GNU as sets the thumb state according to the thumb state of the label.
If a .type directive is placed after the label, set the symbol's thumb
state according to the thumb state of the .type directive. This matches
GNU as in most cases.

From: Stefan Agner <stefan@agner.ch>

This fixes:
https://bugs.llvm.org/show_bug.cgi?id=44860
https://github.com/ClangBuiltLinux/linux/issues/866

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D74927
llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
llvm/test/MC/ARM/thumb-function-address.s [new file with mode: 0644]