ARM ELF: ensure that the tag types are corrected

Ensure that the tag types are reflected on a replacement.  This is particularly
important for the compatibility tag which has multiple representations where the
last definition wins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199577 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool 2014-01-19 08:25:41 +00:00
parent 70c092f3ec
commit d0fb7e49cc
2 changed files with 21 additions and 0 deletions

View File

@ -290,6 +290,7 @@ private:
if (AttributeItem *Item = getAttributeItem(Attribute)) {
if (!OverwriteExisting)
return;
Item->Type = AttributeItem::NumericAttribute;
Item->IntValue = Value;
return;
}
@ -310,6 +311,7 @@ private:
if (AttributeItem *Item = getAttributeItem(Attribute)) {
if (!OverwriteExisting)
return;
Item->Type = AttributeItem::TextAttribute;
Item->StringValue = Value;
return;
}
@ -330,6 +332,7 @@ private:
if (AttributeItem *Item = getAttributeItem(Attribute)) {
if (!OverwriteExisting)
return;
Item->Type = AttributeItem::NumericAndTextAttributes;
Item->IntValue = IntValue;
Item->StringValue = StringValue;
return;

View File

@ -0,0 +1,18 @@
@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj -s -sd \
@ RUN: | FileCheck %s
.syntax unified
.thumb
.eabi_attribute Tag_compatibility, 1
.eabi_attribute Tag_compatibility, 1, "aeabi"
@ CHECK: Section {
@ CHECK: Name: .ARM.attributes
@ CHECK: Type: SHT_ARM_ATTRIBUTES
@ CHECK: SectionData (
@ CHECK: 0000: 41170000 00616561 62690001 0D000000
@ CHECK: 0010: 20014145 41424900
@ CHECK: )
@ CHECK: }